Containing a failing dependency
medium 7 minA timeout bounds how long a caller waits.
Video lesson · Chapter 1 of 4
Retries keep an unhealthy service busy
Theory
Read or listen first. About 2 min.
What it is
A timeout bounds how long a caller waits. A deadline bounds the whole operation and can be propagated to downstream calls. A retry issues more work and requires a policy for side effects. Backoff and jitter spread attempts over time. Bulkheads and circuit breakers limit how much capacity one failing dependency can occupy.
Why it exists
A payment dependency slows down and several layers retry independently. Count attempts at the deepest dependency per logical request. A timeout leaves the outcome uncertain, especially for writes. Use a stable operation ID, one deliberate retry layer, bounded attempts and enough remaining deadline for useful work. Rejecting excess work early can let successful requests continue.
If logical demand grew as fast as attempt volume, retries alone cannot explain the load. Evaluate admission and service capacity.
Retries keep an unhealthy service busy
Inside this chapter
- Circuit Breakers (Fail fast)
- A breaker temporarily stops sending calls after a defined failure signal, then probes for recovery. It needs scope and thresholds that avoid isolating healthy traffic unnecessarily.
- Bulkheads (Fault isolation)
- Bulkheads reserve separate capacity pools so one slow dependency cannot exhaust every worker. Isolation can leave some capacity idle, which is the cost of containment.
- Retry Logic with Exponential Backoff and Jitter
- Backoff spaces attempts, jitter reduces synchronized retry waves, and a retry budget caps amplification. Idempotency determines whether another attempt can duplicate a side effect.
- Timeouts and Deadline propagation
- An end-to-end deadline includes queues, retries and downstream work. Pass the remaining budget, account for cancellation and avoid starting work that cannot finish usefully.
- Chaos Engineering basics
- A controlled reliability experiment starts with a measurable steady state, a bounded scope and an abort condition. Verify that the experiment’s evidence supports the recovery assumption being tested.
- Failover Strategies: Active-Passive, Active-Active
- Active-passive keeps reserve serving capacity, while active-active normally serves from several locations. Replication state, spare headroom and routing convergence determine actual failover behavior.
- Health Checks and Liveness/Readiness Probes
- Liveness asks whether a restart may help. Readiness asks whether traffic should be admitted. A startup check can protect initialization from premature liveness action.
How it works
Step through the idea, or press Play.
Closed. Requests pass normally while the breaker measures outcomes.
Understand it
Worked incident
Retries keep an unhealthy service busy
| Observation | Attempts per 100 user requests (attempts) | Interpretation |
|---|---|---|
| Baseline | 102 | Only occasional transient failures need a second attempt. |
| Incident | 280 | A slowdown drives 280 attempts for 100 logical requests. |
| After intervention | 113 | Limit retries within the request budget and verify successful orders alongside dependency load. |
Choose the next investigation
Summary
The whole topic in one minute.
A remote write may have committed before its response was lost. Duplicate protection ties repeated attempts to one operation.
If logical demand grew as fast as attempt volume, retries alone cannot explain the load. Evaluate admission and service capacity.