Skip to content
StackDecode
System Design
12. Reliability and Fault ToleranceAnimated

Timeout Management

Choosing and propagating deadlines.

The idea

Set timeouts below the caller's own deadline, and pass deadlines downstream.

Watch it work

Press play, pause, or step through. Some animations have settings you can change.

try 1

Attempt 1 fails. Wait 1s plus up to 1s random jitter, then retry.

attempt:
1
next wait:
1
1/6

Exponential backoff spaces retries out; jitter stops every client retrying at the same moment.

Step by step

  1. 1Set an overall deadline
  2. 2Give each call a share
  3. 3Cancel work after the deadline
  4. 4Handle the timeout error

Where it is used

Chains of calls.

Watch out for

Timeouts longer than the caller's cause wasted work.

Related