Skip to content

feat: Support new 2026 retries#3379

Open
richardwang1124 wants to merge 11 commits into
version-3from
feature/new-retries
Open

feat: Support new 2026 retries#3379
richardwang1124 wants to merge 11 commits into
version-3from
feature/new-retries

Conversation

@richardwang1124
Copy link
Copy Markdown
Contributor

This PR adds support for new 2026 retries behavior, including changing the default retry mode, updating retry quotas, and introducing new behavior for long-polling operations and retry backoff headers.


By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.

@richardwang1124 richardwang1124 requested a review from a team as a code owner May 12, 2026 16:49
@github-actions
Copy link
Copy Markdown

Detected 1 possible performance regressions:

  • aws-sdk-core.gem_size_kb - z-score regression: 407.5 -> 408.5. Z-score: Infinity

Comment thread build_tools/services.rb Outdated

# Minimum `aws-sdk-core` version for new gem builds
MINIMUM_CORE_VERSION = "3.247.0"
MINIMUM_CORE_VERSION = "3.248.0"
Copy link
Copy Markdown
Contributor Author

@richardwang1124 richardwang1124 May 12, 2026

Choose a reason for hiding this comment

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

Note to self to check this before merging.

Copy link
Copy Markdown
Contributor

@jterapin jterapin left a comment

Choose a reason for hiding this comment

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

Nice - you should check with everyone else when these changes should be going out. Also is there a blog post or documentation on how new standard retries work?

Comment thread gems/aws-sdk-core/lib/aws-sdk-core/plugins/retry_errors.rb Outdated
Comment thread gems/aws-sdk-core/lib/aws-sdk-core/plugins/retry_errors.rb Outdated
if RetryErrors.new_retries?
backoff_scalar = if error_inspector.throttling_error?
1
elsif ['DynamoDB', 'DynamoDB Streams'].include?(service_id)
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.

We can make a quick helper check since we do this multiple times - like dynamodb_service?(cfg)

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.

I can define a constant which contains the list of DynamoDB related services, I think the check is simple enough that we don't need any method overhead.

# - Remove the old retries branch in #exponential_backoff
# - Remove LEGACY_RETRY_COST and TIMEOUT_RETRY_COST from RetryQuota
# @api private
def self.new_retries?
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.

We have a quite a bit class methods here - we might as well do class << self to group there.

Comment thread gems/aws-sdk-core/CHANGELOG.md Outdated

* Feature - Add YJIT & ZJIT tracking to user agent.
* Issue - Fix error messaging in SSO OIDC.
* Feature - Add new retry behavior behind `AWS_NEW_RETRIES_2026` environment variable. When enabled, defaults to `standard` retry mode, service-specific tuning for DynamoDB, long-polling backoff support, and `x-amz-retry-after` header support.
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.

This changelog entry is a dense read with internal details so maybe:

* Feature - Add `AWS_NEW_RETRIES_2026` environment variable to opt-in to updated
  `standard` retry mode with reduced backoff intervals.

We may want to consider having changelog entries in DyanmoDB/DynamoDBStreams - customers who uses these service gems may not necessarily look at the core gem updates. I think we do generate a default "take a look at core for generated changes" but we could have more meaningful change entry for these services


# Hard-coded combination of services and operations as having the
# longPoll trait. To be removed when trait is enabled.
LONG_POLLING_OPERATIONS = {
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.

I'm not comfortable with service-specific logic living in core. I recognize this pattern exists in V3, but we should be more intentional about this in V4.

Comment thread gems/aws-sdk-core/spec/aws/plugins/retries/retry_quota_spec.rb
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants