Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Separate retry backoff calculation from retry scheduling #171

Closed
2 tasks
jbelkins opened this issue Mar 15, 2023 · 3 comments
Closed
2 tasks

Separate retry backoff calculation from retry scheduling #171

jbelkins opened this issue Mar 15, 2023 · 3 comments
Labels
blocked Work is blocked on this issue for this codebase. Other labels or comments may indicate why. feature-request A feature should be added or improved.

Comments

@jbelkins
Copy link
Contributor

Describe the feature

Smithy Reference Architecture defines the RetryBackoffStrategy type, which (translated to Swift) is:

public protocol RetryBackoffStrategy {
    func computeNextBackoffDelay(attempt: Int) -> TimeInterval
}

Calling the computeNextBackoffDelay(attempt:) method on this protocol allows a client to determine the delay to wait before performing a retry. The client can then use this delay to schedule retry using the scheduling mechanism and HTTP client of their choice.

Looking at the CRT implementation of retry, aws-c-io does not expose such a method, even though it does calculate the needed delay internally. Instead, it appears that the C function aws_retry_strategy_schedule_retry is provided, which calculates the delay and schedules the retry, after the appropriate delay, on CRT's own event loop. (aws-crt-swift uses this C method in its scheduleRetry(token:errorType:) method for its own public retry interface.)

Please provide methods for determining retry backoff delay separate from the methods for scheduling retry; this will assist with compliance with the Smithy Reference Architecture and with future modularization work on the AWS SDK for Swift.

Use Case

Allows for use of CRT's retry backoff logic with non-CRT HTTP clients.

Proposed Solution

No response

Other Information

No response

Acknowledgements

  • I may be able to implement this feature request
  • This feature might incur a breaking change
@jbelkins jbelkins added needs-triage This issue or PR still needs to be triaged. feature-request A feature should be added or improved. labels Mar 15, 2023
@epau epau added blocked Work is blocked on this issue for this codebase. Other labels or comments may indicate why. and removed needs-triage This issue or PR still needs to be triaged. labels Mar 20, 2023
@epau
Copy link
Contributor

epau commented Mar 20, 2023

Blocked: Needs more information on exactly what is required.

@jbelkins
Copy link
Contributor Author

This feature is implemented in smithy-swift and further CRT support for retry is not required. Closing.

@github-actions
Copy link

⚠️COMMENT VISIBILITY WARNING⚠️

Comments on closed issues are hard for our team to see.
If you need more assistance, please either tag a team member or open a new issue that references this one.
If you wish to keep having a conversation with other community members under this issue feel free to do so.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
blocked Work is blocked on this issue for this codebase. Other labels or comments may indicate why. feature-request A feature should be added or improved.
Projects
None yet
Development

No branches or pull requests

2 participants