← Lessons

quiz vs the machine

Platinum1880

Concurrency

The Deadline Propagation

Carrying an absolute time budget through a call chain so every layer respects the same overall limit.

6 min read · advanced · beat Platinum to climb

A budget for the whole request

A single request often fans out across many services and steps. If each layer sets its own independent timeout, the total can balloon well past what the caller is willing to wait. Deadline propagation fixes this by carrying one absolute deadline through the entire chain, so every layer shares the same finish line.

Deadlines versus timeouts

There is a subtle but important difference.

  • A timeout is a relative duration, like wait three seconds, restarted at each hop.
  • A deadline is an absolute point in time, like finish by this clock instant, shared by all hops.

With a deadline, time already spent upstream is subtracted automatically. A downstream call sees only the remaining budget, never a fresh full timer.

Behavior at each hop

Every layer treats the deadline as a hard limit.

  • Compute the remaining time as deadline minus now.
  • If the remaining time is already gone, fail fast without even trying.
  • Pass the same deadline to the next call so it inherits the shrinking budget.

This prevents wasted work on requests that can no longer finish in time.

Key idea

Deadline propagation carries one absolute time budget through a call chain so each hop sees only the remaining time, failing fast when it is exhausted instead of letting per layer timeouts stack up.

Check yourself

Answer to earn rating on the learn ladder.

1. How does a deadline differ from a timeout?

2. What does a downstream call see when a deadline propagates?

3. What should a hop do if the remaining time is already gone?