-
Notifications
You must be signed in to change notification settings - Fork 202
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
Feature: make retry strategy exponential backoff multiplier configurable #1548
Conversation
update: smithy client to respect configurable backoff update: CHANGELOG.next.toml
A new generated diff is ready to view.
A new doc preview is ready to view. |
update: default backoff multiplier to be 1 second to better match previous retry behavior
…retry-base-multiplier
A new generated diff is ready to view.
A new doc preview is ready to view. |
A new generated diff is ready to view.
A new doc preview is ready to view. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this looks great! the one change I'd make is considering renaming with_backoff_multiplier
to initial_backoff
—it's what we call it in the interior code and I think it's a bit more grokable. But totally open to discuss this
update: calculate_exponential_backoff tests for readability
A new generated diff is ready to view.
A new doc preview is ready to view. |
CHANGELOG.next.toml
Outdated
|
||
[[aws-sdk-rust]] | ||
message = """ | ||
Updated SDK Client retry behavior to allow for a configurable backoff multiplier. Previously, the backoff multiplier |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
backoff multiplier -> initial delay
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nice! LGTM
A new generated diff is ready to view.
A new doc preview is ready to view. |
A new generated diff is ready to view.
A new doc preview is ready to view. |
NOTE: I plan to allow for user-defined retry strategies in a separate PR.
Motivation and Context
aws-sdk-rust#567
Description
Updated SDK Client retry behavior to allow for a configurable backoff multiplier.
Previously, the backoff multiplier (named
r
in the code) was set to 2 seconds. This is not an ideal default for services like DynamoDB that expect clients to quickly retry failed request attempts. Now, users can set quicker (or slower) multipliers according to their needs.For a request that gets retried 3 times, when base is 1 and initial_backoff is 2 seconds:
For a request that gets retried 3 times, when base is 1 and initial_backoff is 30 milliseconds:
Testing
I wrote some test for the backoff calculation and ran existing retry tests
Checklist
CHANGELOG.next.toml
if I made changes to the smithy-rs codegen or runtime cratesCHANGELOG.next.toml
if I made changes to the AWS SDK, generated SDK code, or SDK runtime cratesBy submitting this pull request, I confirm that you can use, modify, copy, and redistribute this contribution, under the terms of your choice.