-
Notifications
You must be signed in to change notification settings - Fork 9.2k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Investigate AWS SDK for Go v2 default retry configuration #36024
Comments
Community NoteVoting for Prioritization
Volunteering to Work on This Issue
|
After discussion with the AWS Go SDK team, we have decided to follow the newly published guidance and by default configure a |
This functionality has been released in v5.42.0 of the Terraform AWS Provider. Please see the Terraform documentation on provider versioning or reach out if you need any assistance upgrading. For further feature requests or bug reports with this functionality, please create a new GitHub issue following the template. Thank you! |
I'm going to lock this issue because it has been closed for 30 days ⏳. This helps our maintainers find and focus on the active issues. |
Background
AWS services maintain API rate limits which are used to protect the performance and availability of the service. If a service’s API rate limit is exceeded then the caller will receive a throttling error (usually
RequestLimitExceeded
orThrottlingException
) and subsequent API calls are throttled. AWS SDKs implement techniques to limit the impact of throttling on applications, including:AWS SDK for Go v1
The Terraform AWS Provider’s
max_retries
configuration attribute populates the SDK’sConfig.MaxRetries
field. The default value is 25.The
DefaultRetryer
is used, with onlyNumMaxRetries
modified from its default value.Retry logic is similar for throttling and non-throttling errors (only min and max delays differ); most notably, the max number of retries is the same. Note that the retries are per-request, not shared.
AWS SDK for Go v2
In addition to
max_retries
the Terraform AWS Provider’sretry_mode
configuration attribute determines whether standard or adaptive retry strategies are used (the default is the standard strategy).The AWS SDK for Go v2 SDK
retryer
uses a token bucket for retrying throttling errors. This token bucket is shared across ALL requests for an API client.The Problem
After migration of services from AWS SDK for Go v1 to v2 we have received multiple reports (see linked GitHub Issues) of frequent operation failures: failed to get rate limit token, retry quota exceeded, 0 available, 5 requested, which is a
QuotaExceededException
.Configuring
retry_mode = "adaptive"
is only a partial solution as retry tokens (as opposed to request tokens) don’t cause a sleep before retry.Increasing
token_bucket_rate_limiter_capacity
to a large value (it's default is 500) seems to resolve the issue but as we migrate more (and eventually all) services to AWS SDK for Go v2 we need to have a useful default configuration for this functionality.Relations
Relates #34669.
Relates #32976.
Relates #35926.
Relates hashicorp/aws-sdk-go-base#933.
Relates hashicorp/aws-sdk-go-base#932.
Relates hashicorp/aws-sdk-go-base#918.
Relates hashicorp/aws-sdk-go-base#915.
Relates #36094.
Relates #25552.
The text was updated successfully, but these errors were encountered: