Repository navigation
Back off with jitter on throttles and the Lex build quota in the integration tests - #168
Draft
AlexDaines wants to merge 1 commit into
Draft
AlexDaines wants to merge 1 commit into
AlexDaines wants to merge 1 commit into
Conversation
…gration tests The IAM and DynamoDB integration clients now use a retry strategy from tests/retries.py that marks the unmodeled 400 throttles as retry safe, so the SDK's throttle backoff applies: full jitter, 1 s base, 20 s cap. The released smithy-python treats an unmodeled error as a throttle only on a 429. IAM matches code Throttling (10 attempts). DynamoDB matches any unmodeled 400 on the five control plane operations that these tests call, since the error keeps no code (6 attempts). Other errors keep today's attempt counts and backoff when max_attempts and retry_mode are unset in the environment (AWS_MAX_ATTEMPTS, AWS_RETRY_MODE) and the profile; these test clients still read and validate those settings but no longer apply them to retries. The retry quota rises from 500 to 10,000 tokens. The Lex fixture waits out the bot-locale-builds-per-account quota with a jittered loop and a 900 s deadline, and deletes its bot when the build fails. Remove the strategy when the pins move to a release with smithy-python#955.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
Concurrent builds hit three limits of the shared integration test account: the IAM request rate, the DynamoDB control plane rate and the Lex quota of 5 bot locale builds at a time. On 4 December builds failed on each. Nothing retried them: released smithy-python treats an unmodeled error as a throttle only on HTTP 429, and IAM and DynamoDB answer with a 400.
Fix
ThrottleRetryStrategy. A matched error becomes a retry-safe throttle, so the SDK's throttle backoff applies (full jitter, 1 s base, 20 s cap). The match is on the error message, because the HTTP status is attached after the retry loop.code: Throttling(10 attempts). DynamoDB matches any unmodeled 400 on the five control plane operations that the tests call (6 attempts), so a real validation error there is retried up to 5 times.max_attemptsandretry_modeunset in the environment and the profile; these clients' retries now ignore both. The retry quota rises from 500 to 10,000 tokens.A workaround until the pins move to a release with smithy-lang/smithy-python#955 (merged, not released).
Testing
Functional tests cover it offline (wire responses; the botocore
Stubberand a fake clock for Lex). No integration test ran live, so this is not yet shown to remove the failures.By submitting this pull request, I confirm that you can use, modify, copy, and redistribute this contribution, under the terms of your choice.