Skip to content

Use x-amz-retry-after for suggested delay#6914

Merged
dagnir merged 2 commits intofeature/master/2026-new-retriesfrom
dongie/2026-new-retries/x-amz-retry-after
Apr 29, 2026
Merged

Use x-amz-retry-after for suggested delay#6914
dagnir merged 2 commits intofeature/master/2026-new-retriesfrom
dongie/2026-new-retries/x-amz-retry-after

Conversation

@dagnir
Copy link
Copy Markdown
Contributor

@dagnir dagnir commented Apr 28, 2026

Motivation and Context

In retries 2.1, 'x-amz-retry-after' must be parsed from the last response and if present, should be used as the suggested delay (i.e. suggested backoff) when attempting another retry.

This changes makes updates to RetryableStage and AsyncRetryableStage to parse the header and pass it to the RetryStrategy. As part of this change, we also need to plumb whether retries 2.1 is enabled from the SDK client.

Modifications

  • pass NEW_RETRIES_2026_ENABLED in the execution context
  • (If v2.1 enabled) Parse x-amz-retry-after in sync/async retry stages and use in suggestedDelay() when calling refreshRetryToken().

Testing

  • New unit tests.

Screenshots (if appropriate)

Types of changes

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)

Checklist

  • I have read the CONTRIBUTING document
  • Local run of mvn install succeeds
  • My code follows the code style of this project
  • My change requires a change to the Javadoc documentation
  • I have updated the Javadoc documentation accordingly
  • I have added tests to cover my changes
  • All new and existing tests passed
  • I have added a changelog entry. Adding a new entry must be accomplished by running the scripts/new-change script and following the instructions. Commit the new file created by the script in .changes/next-release with your changes.
  • My change is to implement 1.11 parity feature and I have updated LaunchChangelog

License

  • I confirm that this pull request can be released under the Apache 2 license

@dagnir dagnir requested a review from a team as a code owner April 28, 2026 16:07
@dagnir dagnir force-pushed the dongie/2026-new-retries/x-amz-retry-after branch 2 times, most recently from 97b0ed4 to ecd324a Compare April 28, 2026 17:16
In retries 2.1, 'x-amz-retry-after' must be parsed from the last
response and if present, should be used as the suggested delay (i.e.
suggested backoff) when attempting another retry.

This changes makes updates to RetryableStage and AsyncRetryableStage to
parse the header and pass it to the RetryStrategy. As part of this
change, we also need to plumb whether retries 2.1 is enabled from the
SDK client.
@dagnir dagnir force-pushed the dongie/2026-new-retries/x-amz-retry-after branch from ecd324a to 575b7ce Compare April 28, 2026 17:39
@sonarqubecloud
Copy link
Copy Markdown

Quality Gate Failed Quality Gate failed

Failed conditions
34 Security Hotspots
C Reliability Rating on New Code (required ≥ A)
C Security Rating on New Code (required ≥ A)

See analysis details on SonarQube Cloud

Catch issues before they fail your Quality Gate with our IDE extension SonarQube for IDE

@dagnir dagnir merged commit 4de251e into feature/master/2026-new-retries Apr 29, 2026
21 of 31 checks passed
@github-actions
Copy link
Copy Markdown

This pull request has been closed and the conversation has been locked. Comments on closed PRs are hard for our team to see. If you need more assistance, please open a new issue that references this one.

@github-actions github-actions Bot locked as resolved and limited conversation to collaborators Apr 29, 2026
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants