Systems & Backend

Timeout

A cap on how long to wait for an operation before giving up — the most basic and most-forgotten resilience control.

A timeout is the maximum time a caller will wait for an operation (a network request, a lock, a query) before giving up and returning an error. It is the simplest resilience mechanism — and the one most often missing or set wrong.

Worked example: an HTTP client with a 2-second timeout on a downstream call fails fast when that service hangs, freeing the thread to serve other requests instead of blocking forever. Gotcha: no timeout (or an infinite default) is a leading cause of cascading failure — one slow dependency ties up every thread until the whole service hangs — but a timeout too short causes spurious failures and retries under normal load; timeouts must be set deliberately per call and paired with retries-with-backoff and circuit breakers, not left at the library default.