Resilience testing: timeouts, retries, circuit breakers and graceful degradation
Test a slow service without losing the main task: share a deadline, retry only when safe, check breaker recovery and show an honest smaller result.
L1–L4 are part of the Pro pass
L0 Explain simply
Analogy: a waiter and a slow kitchen. The soup is late. A waiter checks the order, limits the wait and offers bread while the guest decides what to do. The waiter does not claim the soup arrived. Leaving the kitchen door does not stop the cook.
Daily List is a to-do list app. It shows weather beside today's tasks. Lily wants her list, but the outside weather service is slow. Tom tests whether that small fault stops her whole day.
Leo sets a time limit. The app may ask again if that is safe and time remains. Otherwise it shows the tasks with a note that weather is missing. Keeping a useful but smaller service is called .
A is a guard that can stop new calls when its failure rule is met. It watches calls across time. It does not have to open each time one request runs out of tries. The task list can still appear while that guard is closed.
Tom checks the screen, the number of calls and the work left running. A screen that stops waiting does not prove the other service stopped working. Nor does a missing reply prove that a save failed.
Picture limit: software needs rules for many users at once. Bread cannot stand in for a saved task, and a waiter cannot model every server race. SYNTHETIC / TRAINING ONLY: Daily List and the people in this example are invented.
PICTURE IT
The picture is the one the lesson above opens with. The table below shows how each part of it matches the software.
THE REAL JOB Rules and tests for what an app does when a part it relies on is slow or broken.
- Limit the wait
- Retry only when safe
- Guard new calls
- Keep the result honest
HOW THE PICTURE MAPS
| In the picture | In the software |
|---|---|
| The waiter limits the guest’s wait | The caller has a time limit |
| Checking the same order instead of placing a second one | A retry must not create an extra intended effect |
| Pausing new orders when the kitchen cannot keep up | A circuit breaker can refuse new calls under its own failure rule |
| Offering bread and explaining the missing soup | A useful reduced result must be honest |
WHERE THIS PICTURE STOPS
- Leaving the kitchen does not stop the cook. A timeout does not prove the server stopped or undid a write.
- The bread can arrive before any kitchen-wide pause. Reduced service does not require the breaker to open first.
- One waiter cannot model many clients, overlapping writes or server-side repeat protection.
HOOK
Limit the wait. Check the same order. Keep the smaller result honest.
REMEMBER IT THIS WAY
A story beat: one picture-line that carries the order or the cause.
The weather is late. Limit the wait, repeat only when safe and keep the smaller result honest.
| In the trick | What it stands for |
|---|---|
| Limit the wait | Leo sets a time limit |
| Repeat only when safe | The app may ask again if that is safe and time remains |
| Keep the smaller result honest | it shows the tasks with a note that weather is missing |
A task save is not an optional weather read, so a lost reply needs a status check or a safe repeat.
TELL A FRIEND
A waiter limits the wait, checks the same order and offers an honest smaller result. A kitchen-wide pause is a separate rule, not the next step after every late dish.
OFTEN MIXED UP WITH Chaos engineering basics. This lesson tests chosen rules for a failing dependency. Chaos engineering uses bounded experiments to test wider system behavior; it is not limited to live production.
Sources & standards — 4 sources
- Market practice
Timeouts, retries, and backoff with jitter ↗ — Amazon Web Services · Timeouts; retries and backoff; jitter. Values depend on observed response times and tolerated false timeouts; timeout is not evidence that side effects did not occur. Relevant primary passage opened 8 November 2026.
Relevant primary passages opened 8 November 2026. Supports the named pattern or implementation, not universal numeric settings. Synthetic test cases are editorial. No live fault injection or provider operation was performed.
- Market practice
Circuit Breaker pattern ↗ — Microsoft · Solution and problems and considerations. Failure window, open timer, bounded half-open probes, success threshold, failed probe returning to Open; circuit scope and resource limits. Relevant primary passage opened 8 November 2026.
Relevant primary passages opened 8 November 2026. Supports the named pattern or implementation, not universal numeric settings. Synthetic test cases are editorial. No live fault injection or provider operation was performed.
- Market practice
Architecture strategies for self-healing and self-preservation ↗ — Microsoft · Implement a graceful degradation mode. Preserve essential functions through a planned alternate path and tell users what changed. Relevant primary passage opened 8 November 2026.
Relevant primary passages opened 8 November 2026. Supports the named pattern or implementation, not universal numeric settings. Synthetic test cases are editorial. No live fault injection or provider operation was performed.
- Simplified educational illustration
Payments Signal editorial teaching models — Payments Signal · Synthetic Daily List test policies, timing fixtures, counterexamples and waiter analogy. Numbers are chosen for this exercise, not provider defaults or a universal standard.
Used wherever diagrams, scenarios, figures, or example values are didactic constructions rather than sourced facts; every such use carries a simplifications disclosure. All people, companies, banks, and list entries in examples are fictional.
PRACTISE AND KEEP
Sources for this topic — 11 sources
- Market practice
Timeouts, retries, and backoff with jitter ↗ — Amazon Web Services · Timeouts; retries and backoff; jitter. Values depend on observed response times and tolerated false timeouts; timeout is not evidence that side effects did not occur. Relevant primary passage opened 8 November 2026.
Relevant primary passages opened 8 November 2026. Supports the named pattern or implementation, not universal numeric settings. Synthetic test cases are editorial. No live fault injection or provider operation was performed.
- Market practice
Making retries safe with idempotent APIs ↗ — Amazon Web Services · Reducing client complexity; retries and semantic equivalence; late arriving requests; same client request ID, different intent. Server-side repeat detection and writes must form an all-or-nothing operation. Relevant primary passage opened 8 November 2026.
Relevant primary passages opened 8 November 2026. Supports the named pattern or implementation, not universal numeric settings. Synthetic test cases are editorial. No live fault injection or provider operation was performed.
- Implementation-specific
Deadlines ↗ — gRPC Authors · Deadlines on the client and server; deadline propagation. The client stops waiting; the application must stop spawned work; propagation deducts elapsed time and support varies by language. Relevant primary passage opened 8 November 2026.
Relevant primary passages opened 8 November 2026. Supports the named pattern or implementation, not universal numeric settings. Synthetic test cases are editorial. No live fault injection or provider operation was performed.
- Implementation-specific
Cancellation ↗ — gRPC Authors · Overview and cancelling an RPC call on the client side. The handler cooperates with cancellation and should stop ongoing work. Relevant primary passage opened 8 November 2026.
Relevant primary passages opened 8 November 2026. Supports the named pattern or implementation, not universal numeric settings. Synthetic test cases are editorial. No live fault injection or provider operation was performed.
- Market practice
Circuit Breaker pattern ↗ — Microsoft · Solution and problems and considerations. Failure window, open timer, bounded half-open probes, success threshold, failed probe returning to Open; circuit scope and resource limits. Relevant primary passage opened 8 November 2026.
Relevant primary passages opened 8 November 2026. Supports the named pattern or implementation, not universal numeric settings. Synthetic test cases are editorial. No live fault injection or provider operation was performed.
- Market practice
Recommendations for handling transient faults ↗ — Microsoft · Retry eligibility, count and interval, anti-patterns and testing. Total elapsed time includes all attempts and waits; inspect built-in retry policies. Relevant primary passage opened 8 November 2026.
Relevant primary passages opened 8 November 2026. Supports the named pattern or implementation, not universal numeric settings. Synthetic test cases are editorial. No live fault injection or provider operation was performed.
- Market practice
Architecture strategies for self-healing and self-preservation ↗ — Microsoft · Implement a graceful degradation mode. Preserve essential functions through a planned alternate path and tell users what changed. Relevant primary passage opened 8 November 2026.
Relevant primary passages opened 8 November 2026. Supports the named pattern or implementation, not universal numeric settings. Synthetic test cases are editorial. No live fault injection or provider operation was performed.
- Market practice
Architecture strategies for reliability testing ↗ — Microsoft · End-to-end reliability targets; transient faults; self-preservation and recovery; controlled fault injection and experiment boundaries. Relevant primary passage opened 8 November 2026.
Relevant primary passages opened 8 November 2026. Supports the named pattern or implementation, not universal numeric settings. Synthetic test cases are editorial. No live fault injection or provider operation was performed.
- Market practice
Bulkhead pattern ↗ — Microsoft · Context and solution. Partition resource pools so a failed dependency cannot consume all capacity needed by other flows. Relevant primary passage opened 8 November 2026.
Relevant primary passages opened 8 November 2026. Supports the named pattern or implementation, not universal numeric settings. Synthetic test cases are editorial. No live fault injection or provider operation was performed.
- Market practice
Retry pattern ↗ — Microsoft · Retry strategies and idempotency. Cancel on faults unlikely to clear; record attempts and final outcomes; retry choice depends on the operation. Relevant primary passage opened 8 November 2026.
Relevant primary passages opened 8 November 2026. Supports the named pattern or implementation, not universal numeric settings. Synthetic test cases are editorial. No live fault injection or provider operation was performed.
- Simplified educational illustration
Payments Signal editorial teaching models — Payments Signal · Synthetic Daily List test policies, timing fixtures, counterexamples and waiter analogy. Numbers are chosen for this exercise, not provider defaults or a universal standard.
Used wherever diagrams, scenarios, figures, or example values are didactic constructions rather than sourced facts; every such use carries a simplifications disclosure. All people, companies, banks, and list entries in examples are fictional.
Deepest material on this page: L4 — Standards & sources. Where a topic stops short of implementation depth, that is a deliberate coverage decision, not an oversight — see coverage.