Skip to content

Implement updated standard retry behavior#733

Open
Alan4506 wants to merge 1 commit into
smithy-lang:developfrom
Alan4506:retries-2.1-sep-update-v2
Open

Implement updated standard retry behavior#733
Alan4506 wants to merge 1 commit into
smithy-lang:developfrom
Alan4506:retries-2.1-sep-update-v2

Conversation

@Alan4506

@Alan4506 Alan4506 commented Jul 2, 2026

Copy link
Copy Markdown
Contributor

Description of changes:

Updates the standard retry behavior:

  • Throttling backoff: throttling errors use a larger base backoff (1000ms) than other errors (50ms), based on error.is_throttling_error.
  • Retry quota: RETRY_COST is now 14, throttling retries cost 5, and the timeout-specific cost is removed.
  • DynamoDB defaults: DynamoDB / DynamoDB Streams clients default to 4 max attempts and a 25ms base backoff, applied per-value (a value configured by the customer always wins). The generic runtime stays AWS-agnostic; the DynamoDB knowledge lives in an AWS codegen integration.
  • Long-polling: long-polling operations (SQS ReceiveMessage, SFN GetActivityTask, SWF PollForActivityTask/PollForDecisionTask) back off before giving up even when the quota is exhausted. Operation detection uses a per-operation codegen hook so no AWS service names leak into generic codegen.
  • x-amz-retry-after: honored when returned by the service, capped at 5 seconds above the normal backoff; invalid/missing values fall back to normal backoff and the standard HTTP Retry-After is ignored.

Testing:

Added unit tests for each change (throttling vs non-throttling backoff, quota costs, DynamoDB per-value defaults, the long-polling backoff matrix, and x-amz-retry-after parsing/clamping/wiring). Also updated affected functional tests. All Python checks pass (make check-py, make test-py) and the Java codegen builds successfully.

Follow-up:

The awsJson protocol's _create_error is not on develop yet (it lives on the json-rpc branch). Once that merges, it needs the same parse_retry_after(response) wiring that awsQuery already has, so x-amz-retry-after is honored for awsJson services (e.g. DynamoDB) too.

By submitting this pull request, I confirm that you can use, modify, copy, and redistribute this contribution, under the terms of your choice.

@Alan4506 Alan4506 requested a review from a team as a code owner July 2, 2026 16:07
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