Repository navigation
Announcement: Updated default retry behavior (2026) #4789
Replies: 1 comment
Update: The updated retry behavior is now the defaultStarting in What this means for you
Restoring previous behavior In export AWS_RETRY_MODE=legacyThis doesn't restore the previous backoff timing or retry quota costs of explicit We've updated the description with the new version information and revert instructions, and corrected some of the before-and-after values. If you run into unexpected behavior, comment here. |
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 in
boto3andbotocoreversion1.44.0(released November 10, 2026), the updated retry behavior is the default and theAWS_NEW_RETRIES_2026environment variable is removed. To test the updated behavior before you upgrade, see How to opt in early. To restore the previous default behavior after you upgrade, see How to revert.Status
boto3andbotocoreversion1.43.3and laterAWS_NEW_RETRIES_2026=true(removed in version1.44.0)boto3andbotocoreversion1.44.0and later (released November 10, 2026)What changed
Starting in version
1.44.0(or earlier, if you setAWS_NEW_RETRIES_2026=true), the default retry mode changes fromlegacytostandard. Several other retry defaults also update. Thestandardmode adds a retry quota that limits retries when failures are widespread, so your application fails fast instead of waiting on retries that are unlikely to succeed. This also helps service disruptions resolve faster by reducing retry traffic.If you have explicitly configured a retry mode or max attempts, your value takes precedence for that setting. If you use
standardoradaptivemode, the new backoff timing, retry quota costs, and DynamoDB max attempts still apply. See Where you might notice a difference.legacystandardTransient 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
boto3andbotocoreversion1.43.3or later, then set the environment variable:export AWS_NEW_RETRIES_2026=truebotocore reads the variable once, when it's imported, so set it before your application starts.
In version
1.44.0and 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 versions earlier than
1.44.0, remove the environment variable:unset AWS_NEW_RETRIES_2026In version
1.44.0and 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 default behavior, set the retry mode tolegacy:export AWS_RETRY_MODE=legacyOr in code:
Setting the retry mode to
legacyrestores the previous default only. If you explicitly setstandardoradaptivemode before, you can't restore that mode's previous backoff timing (1 s base delay) or retry quota costs (5 tokens, or 10 for connection and read timeouts).Where you might notice a difference
Transient errors recover faster because the base delay is significantly shorter.
standardmode, DynamoDB and DynamoDB Streams max attempts increase from 3 to 4. If your workload relied on a higher retry count to eventually succeed, you may see more errors surfaced to your code. To restore your previous value, set max attempts to 5 withtotal_max_attemptsin code, theAWS_MAX_ATTEMPTSenvironment variable, ormax_attemptsin~/.aws/config. To restore 10 for DynamoDB only, settotal_max_attemptson the DynamoDB client. The environment variable and config file apply one value to all clients.standardmode, previously 5, or 10 for connection and read timeouts). During sustained transient failures (such as 500s and connection resets), the retry quota triggers at a lower failure rate than the previous version of standard mode. Throttling retries cost 5 tokens.SQS.ReceiveMessageapply 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.legacymode,standardmode doesn't retry S3BadDigesterrors or HTTP 509 responses other thanBandwidthLimitExceeded.x-amz-retry-afterresponse header. When a service sends it, the SDK waits at least its own computed backoff and at most 5 seconds longer.Overriding specific settings
You can override the retry mode and max attempts individually. You can't configure backoff timing or retry quota costs. To keep your previous max attempts, set it explicitly. Precedence applies per setting.
For example, to use the new backoff timing but keep a higher DynamoDB max attempts:
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