Skip to content

Factor new retries option in client builder#6887

Merged
dagnir merged 3 commits intofeature/master/2026-new-retriesfrom
dongie/2026-new-retries-internal-default
Apr 23, 2026
Merged

Factor new retries option in client builder#6887
dagnir merged 3 commits intofeature/master/2026-new-retriesfrom
dongie/2026-new-retries-internal-default

Conversation

@dagnir
Copy link
Copy Markdown
Contributor

@dagnir dagnir commented Apr 22, 2026

Motivation and Context

This commit updates the retry mode resolution behavior for SDK clients:

  • When resolving the RetryStrategy to use, also determine whether retry
    2.1 behavior should be enabled for that retry strategy.
  • If the newRetries2026Default property is set in
    customization.config for a service, ensure that this is treated as
    the default option for AWS_NEW_RETRIES_2026 when building the
    client if not set anywhere else.

Modifications

  • Update BaseClientBuilder generation to include SdkClientOption.NEW_RETRIES_2026_DEFAULT in mergeInternalDefaults() if set on the customization.config
  • Update RetryMode.Resolver to reference the AWS_NEW_RETRIES_2026 config when resolving the appropriate RetryMode
  • When constructing the RetryStrategy based on RetryMode, also determine whether 2.1 behavior should be enabled.

Testing

  • New codegen ref tests
  • Unit testing for NewRetries2026Resolver
  • Update RetryMode.Resolver unit testing
  • Runtime testing of retry mode resolution

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 force-pushed the dongie/2026-new-retries-internal-default branch 4 times, most recently from 3572070 to d189e00 Compare April 22, 2026 19:07
@dagnir dagnir marked this pull request as ready for review April 22, 2026 19:22
@dagnir dagnir requested a review from a team as a code owner April 22, 2026 19:22
@dagnir dagnir changed the title WIP Factor new retries option in client builder Apr 22, 2026
This commit updates the retry mode resolution behavior for SDK clients:

 - When resolving the RetryStrategy to use, also determine whether retry
   2.1 behavior should be enabled for that retry strategy.
 - If the `newRetries2026Default` property is set in
   customization.config for a service, ensure that this is treated as
   the default option for `AWS_NEW_RETRIES_2026` when building the
   client if not set anywhere else.
@dagnir dagnir force-pushed the dongie/2026-new-retries-internal-default branch from d189e00 to cd95577 Compare April 22, 2026 19:31
new TestData("lEgAcY", null, null, null, RetryMode.LEGACY),
new TestData("sTanDaRd", null, null, null, RetryMode.STANDARD),
new TestData("aDaPtIvE", null, null, null, RetryMode.ADAPTIVE_V2),
new TestData("legacy", null, null, null, null, null, null, RetryMode.LEGACY),
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nit: seems there are some test appeared repeatedly?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hmm which ones?

Copy link
Copy Markdown
Contributor

@Fred1155 Fred1155 Apr 23, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

line 74 to 79 is identical to 68 to 73?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ah yeah you're right. Will remove!

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nm, realized the intention for 68-73 was for 'false'. Updated.

new TestData("lEgAcY", null, null, null, RetryMode.LEGACY),
new TestData("sTanDaRd", null, null, null, RetryMode.STANDARD),
new TestData("aDaPtIvE", null, null, null, RetryMode.ADAPTIVE_V2),
new TestData("legacy", null, null, null, null, null, null, RetryMode.LEGACY),
Copy link
Copy Markdown
Contributor

@Fred1155 Fred1155 Apr 23, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

line 74 to 79 is identical to 68 to 73?

@sonarqubecloud
Copy link
Copy Markdown

@dagnir dagnir merged commit e528aa4 into feature/master/2026-new-retries Apr 23, 2026
12 of 14 checks passed
@dagnir dagnir deleted the dongie/2026-new-retries-internal-default branch April 23, 2026 17:35
@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 23, 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