recall

← recall

timeout pattern

Every network call has a maximum time it's allowed to wait before giving up. Without timeouts, one slow downstream causes upstream threads to pile up, then queues, then everything. Timeouts are the foundation that all other resilience patterns sit on.

Every network call has a maximum time it's allowed to wait before giving up. Without timeouts, one slow downstream causes upstream threads to pile up, then queues, then everything. Timeouts are the foundation that all other resilience patterns sit on.

symptoms

  • slow downstream cascading into upstream thread exhaustion
  • requests stuck for arbitrarily long
  • circuit breakers never tripping because errors never surface

causes

  • default infinite-timeout in HTTP libraries
  • no deadline propagation across services
  • developers afraid to "fail" so set timeouts too high

fixes

  • explicit timeout on every network call
  • deadline propagation across service boundaries (gRPC-style)
  • tighter than the upstream caller's timeout
  • pair with retries + circuit breakers

you might say

  • set a timeout
  • we don't have a timeout on this call
  • timed out waiting

related

aliases: request timeout, rpc timeout

topics: resilience, failure-modes

references: