Repository navigation
Announcement: Updated default retry behavior (2026) #1431
Pinned
millems
announced in
Announcement
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Important
Update: Starting with the November 10, 2026 release (
aws-configversion1.13.2), the updated retry behavior is the default for every client that usesBehaviorVersion::v2026_11_10()or later, such asBehaviorVersion::latest(), and theAWS_NEW_RETRIES_2026environment variable is removed. To test the updated behavior before you upgrade, see How to opt in early. To restore previous behavior after you upgrade, see How to revert.Status
aws-configversion1.8.17and laterAWS_NEW_RETRIES_2026=true(removed inaws-configversion1.13.2)aws-configversion1.13.2,aws-smithy-runtime-apiversion1.21.0, andaws-smithy-runtimeversion1.16.3and later (released November 10, 2026), for clients that useBehaviorVersion::v2026_11_10()or later, such asBehaviorVersion::latest()What changed
Starting with the November 10, 2026 release (or earlier, if you set
AWS_NEW_RETRIES_2026=true), the retry defaults withinstandardandadaptivemodes update for clients that useBehaviorVersion::v2026_11_10()or later, whether or not you build them withaws-config. The retry mode itself does not change. The DynamoDB and DynamoDB Streams defaults also need theaws-sdk-dynamodbandaws-sdk-dynamodbstreamsversions from that release.AWS_MAX_ATTEMPTSand the profilemax_attemptssetting take precedence for max attempts, DynamoDB clients included. ARetryConfigthat you set in code, onaws_config::defaults()or on a service config, keeps the updated behavior. Its max attempts, initial backoff (throttling only), and max backoff replace the defaults. On DynamoDB, such a config also replaces the 4-attempt default with its own max attempts, which is 3 unless you callwith_max_attempts.Transient errors (such as 500s and connection resets) now use a much shorter backoff than throttling errors (where the service asks you to slow down). For details on backoff timing, error classification, and the retry quota, see Retry behavior in the AWS SDKs. For retry mode selection and configuration options, see Retry behavior in the AWS SDKs.
How to opt in early
Update to
aws-configversion1.8.17or later. Foradaptivemode, useaws-configversion1.10.1or later, which requiresaws-smithy-runtimeversion1.12.1or later. The service crates carry the DynamoDB defaults and the long-polling backoff, so also update any of these that you use to at least the version shown:aws-sdk-dynamodb1.112.0,aws-sdk-sqs1.99.0,aws-sdk-sfn1.105.0,aws-sdk-swf1.101.0. Then set the environment variable:export AWS_NEW_RETRIES_2026=trueThe opt-in doesn't cover everything in the default. With the opt-in, clients built without
aws-configand clients that set aRetryConfigin code keep the previous behavior, DynamoDB ignoresAWS_MAX_ATTEMPTS, and DynamoDB Streams uses the general defaults. The HTTP 429 change in Where you might notice a difference ships only with the default.In
aws-configversion1.13.2and later, the updated behavior is the default and the SDK ignoresAWS_NEW_RETRIES_2026. You can remove it from your configuration after you upgrade.How to revert
In
aws-configearlier than1.13.2, remove the environment variable:unset AWS_NEW_RETRIES_2026In
aws-configversion1.13.2and later, the updated behavior is the default and the SDK ignoresAWS_NEW_RETRIES_2026, so unsetting it or setting it tofalsedoesn't restore the previous behavior. To restore the previous retry behavior, pinBehaviorVersion::v2026_01_12(). This restores every previous retry value except one: an HTTP 429 response with no recognized error code is now retried as a throttling error in every behavior version.For clients that you build with a service
Config::builder()instead ofaws-config, set.behavior_version(BehaviorVersion::v2026_01_12())on that builder.Don't pin anything older than
v2026_01_12. That also reverts the default connect timeout, the default HTTP client, and default retries for clients built withoutaws-config.This SDK doesn't support
legacyretry mode. SettingAWS_RETRY_MODE=legacy(orretry_mode = legacyin a profile) makesaws_config::defaults(...).load()panic.To keep the updated behavior and change only some settings, see Overriding specific settings.
If this is a concern for your use case, please let us know in this issue.
Where you might notice a difference
Transient errors recover faster because the base delay is significantly shorter.
ReceiveMessage, Step FunctionsGetActivityTask, and SWFPollForActivityTaskandPollForDecisionTaskapply a backoff delay before returning an error, even when retries are blocked. Without this, a polling loop would send its next request immediately after each error, spiking client CPU usage and generating additional traffic. For details, see long-polling operations..with_reconnect_mode(ReconnectMode::ReconnectOnTransientError)on yourRetryConfig.x-amz-retry-afterdelays are bounded. When a service sends the header, the SDK waits at least its own computed backoff and at most 5 seconds longer. Previously, the only limit was the 20-second max backoff.BehaviorVersion::v2026_01_12()is deprecated. Code that pins it gets a deprecation warning, and builds that deny warnings fail.Overriding specific settings
You do not have to accept all changes as a bundle, but you can't revert some of them individually. In code,
RetryConfiglets you set max attempts (with_max_attempts), the maximum backoff (with_max_backoff), and the reconnect mode (with_reconnect_mode), and you can supply a customRetryPartitionwith its own token bucket (capacity, costs, and refill). While the updated behavior is on,with_initial_backoffsets only the throttling base delay. If you keep the rest of the updated behavior, you can't restore the previous 1,000 ms transient base delay or the previousadaptivemode rate-limiter behavior, and you can't remove the new bounds onx-amz-retry-afterdelays or the long-polling backoff.Precedence applies per setting for environment variables and profile settings, DynamoDB included. A
RetryConfigset on the loader replaces the environment and profile retry settings with its own values, but it keeps the updated behavior. You can set it on the loader, on a client, or per operation.For example, to keep the new backoff timing and allow 9 attempts for one DynamoDB operation:
For the full list of configurable settings and their precedence, see Retry behavior in the AWS SDKs.
Feedback
If you encounter unexpected behavior or have questions, comment on this issue. If you need a previous value that you can't configure, let us know here.
All reactions