Scrivio Interview library
LeadershipPrincipal7 min read · updated 12 November 2026

Retry storms, where clients retry failed calls and keep an overloaded service from recovering, are a form of livelock at system scale. What long-term standards would you set for retries across your organisation?

I would set five standards: retries use exponential backoff with jitter, never immediate or fixed-interval retries; every client has a retry budget that caps retries at a small share of normal traffic, such as 10%; only idempotent operations are retried, and operations that must be retried are made idempotent; retries happen at one layer only, because retries at every layer multiply load; and services use circuit breakers and load shedding so an overloaded service can recover. Together these stop clients from turning a short overload into a lasting one.

Background to this question

A retry storm is one of the few failures that a healthy system inflicts on itself. A dependency slows down for a moment, every client retries, the extra load keeps the dependency overloaded, and the clients retry again. The system is busy, every component is doing what it was told, and nothing recovers, which is exactly the shape of a livelock at system scale. Because each team's retry code looks reasonable on its own, the fix has to be an organisation-wide standard. In this answer, we will recap why naive retries amplify load, then go through each standard with the numbers that justify it, and end with how to roll the standards out.

1A Quick Recap: How Retries Amplify Load

A retry is a good idea for a single transient failure, such as a dropped connection. The trouble starts when failures are caused by overload. An overloaded service answers slowly or with errors; each client that retries sends another request to the same overloaded service. If every client retries up to 3 times, a failing service receives up to 4 times its normal traffic exactly when it can handle the least.

Layers multiply this. Suppose a request goes through a gateway, service A and service B, and each layer retries 3 times. When B fails, A retries B 3 times for each attempt the gateway makes, and the gateway retries A 3 times: up to 4 x 4 = 16 calls to B for each user request, and more if the user also clicks again. The service that most needs relief gets the most load. Like a livelock, every party is active and nobody makes progress.

Step throughHow a retry storm keeps a service down
  1. Service B slows brieflyfor example a GC pause or a slow query
  2. Clients time out and retry immediatelyload on B doubles or more
  3. Every layer retries tooup to 4 x 4 = 16 calls per user request
  4. B stays overloadedmore timeouts, more retries
  5. Can B shed or clients back off?
    YesB recoversNoThe storm continues until traffic drops

5 steps in order. Play them, or step through them one at a time.

2Standard 1: Exponential Backoff With Jitter

Retries must wait, and the wait must grow: for example 100 ms, then 200, 400 and 800, up to a cap. Growing waits give the dependency time to recover instead of hitting it again at once. But backoff alone is not enough. If a thousand clients failed at the same moment, they all retry after 100 ms, then all after 200 ms, in synchronized waves. Jitter, a random component in each wait, spreads them out. A common form is full jitter, a random wait between zero and the current backoff.

Java
long base = 100, cap = 5_000;
for (int attempt = 0; attempt < 3; attempt++) {
try { return client.call(req); }
catch (TransientException e) {
long backoff = Math.min(cap, base << attempt); // 100, 200, 400 ms
Thread.sleep(ThreadLocalRandom.current().nextLong(backoff + 1)); // full jitter: 0..backoff
}
}
return client.call(req); // last attempt; its failure propagates

In practice, teams should not write this loop themselves; the shared client library or a resilience library provides it, with the defaults set by the platform.

3Standard 2: Retry Budgets

Backoff limits how fast one request retries; a budget limits how much retrying the whole client does. A retry budget says that retries may add at most a fixed share of normal traffic, for example 10%. The client counts requests and retries over a short window, and once retries reach 10% of requests, further failures are returned to the caller without retrying.

The effect is large. Without a budget, a fully failing dependency receives up to 4 times normal load from clients retrying 3 times. With a 10% budget, it receives at most 1.1 times normal load, so failing calls cost almost nothing extra and the dependency gets a chance to recover. During normal operation, when failures are rare, the budget is never reached and retries still smooth over transient errors.

4Standard 3: Retry Only Idempotent Operations

An operation is idempotent if doing it twice has the same effect as doing it once, such as reading a record or setting a value. A timeout does not tell us whether the server did the work, so retrying a non-idempotent operation, such as charging a card, can do it twice. The standard is that clients retry only operations that are idempotent, and that operations that must be retryable are made idempotent, typically with an idempotency key: the client sends a unique key with the request, and the server stores the result per key and returns it again for a repeated key instead of repeating the work.

Without this standard, teams either avoid retries where they are needed or retry where they are dangerous.

5Standard 4: Retry at One Layer Only

Because retries multiply across layers, only one layer in a call chain should retry, usually the one closest to the failing dependency, which knows best whether the error is transient. All layers above pass the failure up without retrying. Retrying at the edge as well, for example in the gateway, should be the documented exception, not the default.

A simple mechanism helps: a service that has already retried and still failed returns an error that says so, for example a specific status or header, and callers do not retry such errors. Shared client libraries can enforce this automatically.

Calls reaching the failing service per user request
Retry policyCalls to the failing service
3 retries at each of 2 layersUp to 16
3 retries at one layerUp to 4
One layer, 10% retry budgetAbout 1.1 on average when failing
Plus an open circuit breakerClose to 0 until a trial call succeeds

6Standard 5: Circuit Breakers and Load Shedding

The last standard protects the overloaded service from both sides. On the client side, a circuit breaker tracks the failure rate of calls to a dependency; when it passes a threshold, the breaker opens and calls fail immediately without being sent, then after a pause a few trial calls test whether the dependency has recovered. That removes load from a struggling service at the moment it needs it most.

On the server side, load shedding means a service rejects excess work quickly, with a clear status such as 503 and possibly a Retry-After header, instead of accepting everything and timing out on all of it. A service that sheds load keeps serving the requests it accepts within their deadlines, which ends the storm much sooner than one that slowly fails everything.

7Rolling the Standards Out

Standards that live only in documents are not followed under deadline pressure. I would build them into the shared HTTP and messaging client libraries as defaults: backoff with jitter, a 10% budget, retries only for idempotent methods unless an idempotency key is present, and circuit breakers per dependency. A service that needs different settings changes them in configuration, visibly, and the review asks why. Metrics for retries, budget exhaustion and breaker state are part of the default dashboards, and game days inject failures into a dependency to check that the storm does not happen.

8Follow-up questions

Why is jitter needed if we already back off exponentially?

Because clients that failed together back off together. Exponential backoff spaces out the retries of one client, but a thousand clients with the same schedule still retry in synchronized waves that hit the dependency at the same moments. Random jitter spreads those waves over time so the load arrives evenly.

What about retries in message consumers?

The same ideas apply. A consumer that fails to process a message should retry with backoff, within limits, and then move the message to a dead-letter topic instead of retrying forever. Immediate redelivery loops are a retry storm against whatever the consumer calls.

How do you choose the 10% budget?

It is a balance: high enough that occasional transient errors are always retried, low enough that a failing dependency sees only a small increase in load. Ten percent is a common starting point, adjusted with data.

9Conclusion

In this answer, we saw that naive retries turn a brief overload into a lasting one, a livelock at system scale, and that layers of retries multiply the load on the failing service. The standards are exponential backoff with jitter, retry budgets that cap retries as a share of normal traffic, retries only for idempotent operations or with idempotency keys, retries at one layer only, and circuit breakers with load shedding so overloaded services can recover. They work when they are the defaults of shared client libraries rather than rules each team implements.

What to say in the interviewAbout 90 seconds aloud

Open with

A retry storm happens because retries add load exactly when a service can least handle it. If every client retries three times, a failing service gets up to four times its normal traffic, and if two layers each retry three times, that becomes sixteen calls per user request.

Then, if they want more

Everyone is busy and nothing recovers, which is why I think of it as a livelock at system scale. I would set five standards. First, retries always use exponential backoff with jitter, never immediate or fixed-interval retries, because clients that fail together would otherwise retry together in waves.

Second, retry budgets: retries may add at most around 10% to normal traffic, so a fully failing dependency sees about 1.1 times its load instead of four times. Third, only idempotent operations are retried, and anything that must be retryable, like a payment, gets an idempotency key so a repeat does not charge twice.

Fourth, retries happen at one layer only, normally the one closest to the dependency, and callers do not retry errors that were already retried. Fifth, circuit breakers on clients and load shedding on servers, so an overloaded service gets breathing room and rejects excess work quickly with a 503 instead of timing out on everything.

And I would ship all of this as defaults in the shared client libraries, with retry and breaker metrics on every dashboard, because standards in a document get skipped.

About this answer

Last updated
12 November 2026
Checked
Its structure and format are checked automatically. Use it as a carefully prepared study note: where a detail matters, confirm it against the documentation below. What the checks cover
Where the question comes from
Written by Scrivio for practice. It is not taken from an interview.
Report an issue with this answer

Copy the line below and send it to the author with what you found. It carries the address of this page.

Issue with "Retry storms, where clients retry failed calls and keep an overloaded service from...": https://scrivio-interview-library.netlify.app/java/concurrency-problems/7ff6bdecc8/