Skip to content

Back off with jitter on throttles and the Lex build quota in the integration tests - #168

Draft
AlexDaines wants to merge 1 commit into
developfrom
adaines/integ-throttle-backoff
Draft

AlexDaines wants to merge 1 commit into
developfrom
adaines/integ-throttle-backoff

Conversation

@AlexDaines

Copy link
Copy Markdown
Collaborator

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

  • A shared test module adds 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.
  • IAM matches 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.
  • Other errors keep today's attempt counts and backoff, as with max_attempts and retry_mode unset in the environment and the profile; these clients' retries now ignore both. The retry quota rises from 500 to 10,000 tokens.
  • The Lex fixture waits out the build quota (jittered loop, 900 s deadline), and a failed build deletes its bot.

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 Stubber and 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.

…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.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant