Count the retries hiding in your call stack
On this page
A gateway, client library and storage adapter can turn one user request into twelve downstream attempts.
Take one request through a gateway, a service client and a storage adapter. Allow two attempts at the gateway, three in the client and two in the adapter. During a sustained failure that reaches every layer, the adapter can issue twelve downstream calls. Every local policy sounds modest.
gateway attempts × client attempts × adapter attempts
2 × 3 × 2 = 12This is a worst-case count for a single chain. It assumes the operation reaches the failing dependency every time and that no deadline cancels an attempt early. Parallel fan-out changes the arithmetic. Record attempts including the initial call so that “retry twice” cannot be mistaken for “try twice.”
Give the deadline an owner
Start with the customer's deadline. Pass the remaining budget to each dependency, reserve time to return the result, and spend another attempt only if enough time remains. A retry at the outermost layer can repeat work already completed. Put it near the operation that knows whether repeating the work is safe, then check whether the SDK has its own policy. Amazon describes both the multiplication effect and that wasted-work trade-off. Amazon Builders’ Library on timeouts and retries.
Read a timeout as an unknown outcome
A reservation may have succeeded before its reply disappeared. A stable operation identifier lets the caller ask for the first result. That requires storage at the service with enough retention to cover the retry window. HTTP defines idempotency in terms of the intended effect of repeating a request. Repeated responses can still differ. Record logical operation IDs alongside physical attempt counts so a dashboard can show both customer impact and dependency load. RFC 9110, idempotent methods.