-
Notifications
You must be signed in to change notification settings - Fork 743
aws : Adds configurations to the default retryer #375
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
Merged
Merged
Changes from 21 commits
Commits
Show all changes
25 commits
Select commit
Hold shift + click to select a range
a68e370
Fixes bug in calculating throttled retry delay
skotambkar ec30fec
Update CHANGELOG_PENDING.md
skotambkar 818b3b7
Update CHANGELOG_PENDING.md
skotambkar c3b6533
Adds suggested changes
skotambkar 9cdb3a9
Adds trailing space in changelog_pending
skotambkar 4fc5212
Ports fix for int overflow in minTime and adds custom retryer for ser…
skotambkar d11e7f7
changes by go fmt: Fixes formatting of the project
skotambkar 30e6541
Adds changelog pending entry
skotambkar 3e83bc7
Updated Changelog_Pending
skotambkar 8aea163
Updates logic for default retryer
skotambkar bde7a06
go lint fixes
skotambkar 1844388
fixes go lint
skotambkar 3c1f0c3
updated test for exhaustive retries
skotambkar 7b68b58
fixed failing test case
skotambkar bd76e4b
adds constructor for default retryer
skotambkar 3d7c0e5
updates test cases to work with constructor for default retryer
skotambkar 5b03a3c
adds no op retryer for zero retries
skotambkar 23d434e
updates to correctly set retryer when service client is initialized
skotambkar cef80f1
adds suggested changes and handles fatal errors in s3 crypto
skotambkar fda8bcb
updates change log pending
skotambkar d813158
go lint changes
skotambkar 38f0857
updates dynamodb customization to use default retryer; adds suggested…
skotambkar 6d52836
adds entries to the changelog pending
skotambkar cacea80
Merge branch 'master' into issue#370
skotambkar 604e9db
Update CHANGELOG_PENDING.md
skotambkar File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,6 +1,12 @@ | ||
| ### SDK Features | ||
|
|
||
| ### SDK Enhancements | ||
|
|
||
| * `aws`: Provides more customization options for retryer by adding a constructor for default Retryer which accepts functional options. Adds NoOpRetryer to support no retry behavior. Exposes members of default retryer. [#375](https://github.com/aws/aws-sdk-go-v2/pull/375) | ||
| * Updates the underlying logic used by the default retryer to calculate jittered delay for retry. | ||
| * Handles int overflow for retry delay. Fixes [#370](https://github.com/aws/aws-sdk-go-v2/issues/370) | ||
| * `service/ec2`: Adds custom retryer implementation for service/ec2. | ||
| * Adds test case to test custom retryer. | ||
|
|
||
| ### SDK Bugs | ||
|
|
||
|
|
||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,24 @@ | ||
| package aws | ||
|
|
||
| import "time" | ||
|
|
||
| // NoOpRetryer provides a retryer that performs no retries. | ||
| // It should be used when we do not want retries to be performed. | ||
| type NoOpRetryer struct{} | ||
|
|
||
| // MaxRetries returns the number of maximum returns the service will use to make | ||
| // an individual API; For NoOpRetryer the MaxRetries will always be zero. | ||
| func (d NoOpRetryer) MaxRetries() int { | ||
| return 0 | ||
| } | ||
|
|
||
| // ShouldRetry will always return false for NoOpRetryer, as it should never retry. | ||
| func (d NoOpRetryer) ShouldRetry(_ *Request) bool { | ||
| return false | ||
| } | ||
|
|
||
| // RetryRules returns the delay duration before retrying this request again; | ||
| // since NoOpRetryer does not retry, RetryRules always returns 0. | ||
| func (d NoOpRetryer) RetryRules(_ *Request) time.Duration { | ||
| return 0 | ||
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,44 @@ | ||
| package aws | ||
|
|
||
| import ( | ||
| "net/http" | ||
| "testing" | ||
| "time" | ||
| ) | ||
|
|
||
| func TestNoOpRetryer(t *testing.T) { | ||
| cases := []struct { | ||
| r Request | ||
| expectMaxRetries int | ||
| expectRetryDelay time.Duration | ||
| expectRetry bool | ||
| }{ | ||
| { | ||
| r: Request{ | ||
| HTTPResponse: &http.Response{StatusCode: 200}, | ||
| }, | ||
| expectMaxRetries: 0, | ||
| expectRetryDelay: 0, | ||
| expectRetry: false, | ||
| }, | ||
| } | ||
|
|
||
| d := NoOpRetryer{} | ||
| for i, c := range cases { | ||
| maxRetries := d.MaxRetries() | ||
| retry := d.ShouldRetry(&c.r) | ||
| retryDelay := d.RetryRules(&c.r) | ||
|
|
||
| if e, a := c.expectMaxRetries, maxRetries; e != a { | ||
| t.Errorf("%d: expected %v, but received %v for number of max retries", i, e, a) | ||
| } | ||
|
|
||
| if e, a := c.expectRetry, retry; e != a { | ||
| t.Errorf("%d: expected %v, but received %v for should retry", i, e, a) | ||
| } | ||
|
|
||
| if e, a := c.expectRetryDelay, retryDelay; e != a { | ||
| t.Errorf("%d: expected %v, but received %v as retry delay", i, e, a) | ||
| } | ||
| } | ||
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.