← Lessons

quiz vs the machine

Gold1460

Concurrency

The Timeout Propagation

Passing a shrinking deadline down a call chain so no stage wastes time on a dead request.

5 min read · core · beat Gold to climb

A deadline that travels

When a request crosses several services, each hop should know how much time is left. Timeout propagation carries a deadline down the call chain so a downstream service never works on a request the caller has already abandoned.

Deadline beats per hop timeout

  • A fixed per hop timeout at each service can sum to far more than the client is willing to wait.
  • A propagated deadline is an absolute time. Each service computes its remaining budget as deadline minus now and passes the rest down.

If only one hundred milliseconds remain, a downstream call that needs two hundred should fail fast rather than start.

Avoiding wasted work

Without propagation, a client gives up at one second but downstream services keep grinding for five, burning capacity on a result no one will read. Propagating the deadline lets every stage cancel early and free its resources.

Key idea

Propagate an absolute deadline rather than independent per hop timeouts, so every stage knows its remaining budget and abandons dead requests early.

Check yourself

Answer to earn rating on the learn ladder.

1. Why is propagating a deadline better than a fixed per hop timeout?

2. What should a service do when the remaining budget is too small for its call?