-
Notifications
You must be signed in to change notification settings - Fork 85
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
fix(core): retry after clock skew correction #1170
Conversation
344d13b
to
68174c9
Compare
Aside: |
It looks like the pre-SRA retry uses the deprecated However, the new To fix this regression, we can either:
|
/** | ||
* The error thrown during the initial request, if available. | ||
*/ | ||
error?: SdkError; |
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.
Users have requested that the thrown exception is available in the retry strategy implementation. Otherwise, they cannot even check (for example) the http status code of an error when deciding whether to retry.
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.
Without this, they are forced to write a verbose retry wrapper instead of using a RetryStrategy.
Updated PR to use option 1. E2E test will be added in AWS SDK. |
433aa21
to
0232225
Compare
PR adds metadata if a clock skew correction occurred after a request error. This metadata, when present, is considered a transient and retryable error.
maxAttempts
must be>=2
to allow clock skew corrections to be retried.Test code, using DynamoDB, which returns a date header that can be used to correct clock skew for sigv4.
Context:
As far as I can tell, a clock skew correction does not trigger a retry anymore, since AWS SDK v3.222.0, which corresponds to the retry SRA.
https://github.com/aws/aws-sdk-js-v3/releases/tag/v3.222.0
Versions tested:
"@aws-sdk/client-dynamodb": "<=3.521.0"
no retry after clock skew correction"@aws-sdk/client-dynamodb": "<=3.450.0"
no retry after clock skew correction"@aws-sdk/client-dynamodb": "<=3.350.0"
no retry after clock skew correction"@aws-sdk/client-dynamodb": "<=3.222.0"
no retry after clock skew correction"@aws-sdk/client-dynamodb": "<=3.221.0"
retry after clock skew correction"@aws-sdk/client-dynamodb": "<=3.100.0"
retry after clock skew correction