Retries that make the outage worse

Intermediate · 6 min · Animated story · 6 scenes

Trying again looks polite. Multiplied across callers and layers, immediate retries add load to the service that is already struggling.

Follow the requestScene 1 / 6

One request, one attempt, one answer.

Illustrative guided sequence, not a simulation or a benchmark.

01 / 06

Normal traffic

A client sends a request to the checkout API. The API calls the payments service once, receives an answer, and replies to the client. There is no retry because nothing failed.

What you will learn

  • Explain how immediate retries multiply load on a failing dependency.
  • Describe exponential backoff and why jitter spreads retries out.
  • Explain how a retry budget and a deadline bound the total work a request can cause.
  • Identify which operations are safe to retry without an idempotency mechanism.
  • State when retrying is the wrong response to a failure.

Transcript

  1. Normal traffic. A client sends a request to the checkout API. The API calls the payments service once, receives an answer, and replies to the client. There is no retry because nothing failed.On screen: One request, one attempt, one answer.
  2. The dependency starts failing. Payments is now degraded and responds too slowly. The API waits, gives up on that call, and reports a timeout to the client. This may be a transient fault, and repeating the call might succeed later.On screen: Payments slows under load, and the caller gets a timeout after one attempt.
  3. Anti-pattern: immediate retries. The API retries each failed call at once, with no wait and no cap in this scene, until the client's timeout ends the call. The animation compresses time and leaves out the failure replies so the growing stream of attempts stays visible. The API sends every copy to payments. Payments is failing, so each attempt adds load and none gets a useful answer. With retries stacked in several layers, the same growth multiplies at each layer.On screen: Immediate retries keep sending copies of the same call to a service that is already overloaded.
  4. Pattern: bounded retries with backoff and jitter. Each client now makes at most three attempts. The waits grow after each failure, and each client waits a different random amount, so the attempts do not line up. After the last attempt the API stops and returns the error, which leaves payments room to recover.On screen: Backoff spaces the attempts out, jitter staggers the clients, and a fixed limit stops the loop.
  5. Budget and deadline end the chain. Before any retry, the API checks two limits. The retry budget says whether more retries are allowed, and the caller's deadline says whether another attempt could finish in time. Here the deadline has passed, so no further attempt starts and the error returns to the client.On screen: When the retry budget is spent or the deadline has passed, stop and return the error.
  6. Recovery: one attempt is enough. Payments recovers and answers the next request on the first attempt. Because the call succeeds, no retry is needed, and the client receives its response with normal latency.On screen: When the dependency is healthy again, a single attempt returns the answer.

Sources

Under the hood

How immediate retries multiply load on a struggling dependency, and how bounded attempts with backoff, jitter, a retry budget and a deadline keep recovery possible.

Trade-offs

  • Retries hide brief faults from users, but each retry costs capacity on a dependency that may be the cause of the fault.
  • Backoff and jitter make recovery slower for an individual request while protecting the dependency as a whole.
  • A budget and a deadline can return errors that a longer retry would have eventually avoided.
  • Retrying side-effecting calls is only safe when the operation is idempotent.

When not to use it

  • The failure is not transient, such as invalid input or a permission error, so repeating the call cannot help.
  • The dependency is overloaded and retries add more load than they remove failures.
  • The operation changes state and has no idempotency mechanism, so a retry could repeat its effect.

Limitations of this lesson

  • The animation shows scripted attempts. It is not a live retry simulation and does not measure load.
  • Backoff values and jitter ranges are illustrative. The durations are not recommended settings.
  • Retry budgets and deadlines are described in narration only; no budget counter is animated.
  • Circuit breaking and load shedding are not shown here.