Throttling, backoff and error classification
Classify errors before retrying
Separate input validation or authorization failures from temporary connectivity or server failures and rate limiting. A 400 status alone is not enough: RequestTimeout and ValidationException have different meanings. Inspect the modeled error code, HTTP status, operation and request ID. For AccessDenied, stop and investigate the intended identity, policy and resource scope; never broaden permissions automatically. For expired credentials use the approved refresh path, not endless retries with the same session. For throttling, reduce concurrency and retry only if safe. The local classifier recognizes a deliberately small list of synthetic cases; unknown errors stop for review.
Backoff, jitter and attempt budgets
Exponential backoff grows the wait between attempts; full jitter chooses a random delay within that growing interval to spread retries. The teaching model uses 100 ms base, 800 ms cap and an injected fraction of 0.5. After two failures the delays are 50 and 100 ms, then the third call may succeed. Three total attempts means one initial call plus two retries. Cap elapsed time and concurrency too: a retry budget per page alone can amplify a long scan. A workflow with ten pages and at most three calls per page can make up to thirty calls, before any other work. Avoid stacking application and SDK retries without calculating the combined limit.
Verify retry semantics for the SDK version
Standard SDK retry behavior uses bounded retries and retry quota mechanisms. Adaptive mode adds client-side rate limiting and can delay first attempts; use it only after considering how resources share a client. AWS has been rolling out revised 2026 retry behavior across SDKs; defaults, backoff values and feature flags depend on SDK version and rollout state. Do not apply a single historical default to all clients. Botocore Config total_max_attempts counts the initial request; max_attempts in that configuration object counts retries. Use the former for clarity. This lab injects deterministic delays without sleeping or testing native SDK retries. Its Botocore client uses total_max_attempts=1 so an outer model is not silently multiplied by SDK retries.
Practice and diagnose with evidence
Run the offline lab in lab-fixtures/sdk-engineering. The synthetic S3 responses contain no real bucket or keys; the tested Botocore paginator and JMESPath query run without HTTP. Compare a retryable throttling error, terminal AccessDenied and a write timeout with unknown result. The application retry helper records synthetic delay values and stops at its limit or deadline; it cannot cancel a real in-flight call. Record operation, attempt count, error code, request ID, elapsed time and approved scope in structured logs, excluding payloads and secrets. Test the actual operation and SDK version separately in an authorized environment. The next chapter applies these diagnostic principles to troubleshooting and performance.
Check Your Understanding
Solidify your learning with the interactive assessment directly below this lesson.
Concept Quiz & Questions
Throttling, backoff and error classification — knowledge check
Reason about bounded, safe SDK automation.
What is the appropriate response to AccessDenied?
How many retries fit three total attempts?
With base 100 ms and fraction 0.5, what are the first two model delays?
What additional effect can adaptive mode have?
A mutation timed out with unknown outcome and no idempotency contract. What now?