Automatic Retries

The AWS SDK will automatically retry failed requests. Amazon's SDKs support three retry modes legacy, standard, and adaptive. The Amazon default mode is "legacy" mode. Currently only the "legacy" mode is supported so setting the RetryMode has no effect but is included for future support.

Legacy Retry Mode

The only parameter affecting legacy mode that can be provided in configuration is MaxAttempts. MaxAttempts can be set via the environment variable AWS_MAX_ATTEMPTS or the configuration key max_attempts. 

MaxAttempts is a limit on the total number of attempts a client will make for a given request. In effect it is setting the RetryLimit to MaxAttempts - 1 (the initial attempt not being counted). If both MaxAttempts and RetryLimit are set, legacy mode uses RetryLimit. 

In addition to MaxAttempts, there are a number of legacy mode specific options:

Option
Description
Base delay value in milliseconds. The actual delay between retries is calculated with an exponential back-off algorithm based on this value.
Specifies how much "jitter" to add into the retry delay. See Retry Jitter below.
Specifies the maximum number of retries are allowed per request.
Specifies the maximum delay between retry attempts in milliseconds.
Retry Jitter

When requests fail and retries are made with an exponential back-off with multiple concurrent processes using the same strategy, the likeliness of the retries clashing with other retries increases. Adding an amount of randomness to the retry delay decreases the likeliness of retries clashing. 

There are three supported jitter modes, none, equal, and full. The default mode is none

For an in-depth explanation of the effect of jitter see Amazon's article Exponential Backoff And Jitter.

Copyright © 2019-2021 Appercept Ltd. All rights reserved.