Scrivio Interview library
ScenarioAdvanced7 min read · updated 12 November 2026

During an outage, retries from many upstream services overloaded a recovering downstream service and extended the outage by an hour. How would you prevent this across teams?

I would standardise retries across teams: exponential backoff with jitter, a small maximum number of attempts, and a retry budget so retries stay a small share of traffic. Callers get circuit breakers, for example with Resilience4j, so they stop calling a failing service, and recovering services shed load and admit traffic gradually. These defaults ship in a shared client library and are tested in game days, so no team has to get them right alone.

Why this question is asked

A retry storm is one of the most common ways a short outage becomes a long one. A downstream service fails for five minutes; every caller retries three times, and their callers retry too; when the service comes back it receives several times its normal traffic and falls over again. The fix is not in any one service, which is why interviewers ask how a senior engineer would solve it across teams. In this answer, we will see how retries multiply load, then build the defences layer by layer: backoff with jitter and capped attempts, retry budgets, circuit breakers, load shedding and gradual admission at the recovering service, and finally how to roll this out through a shared library and prove it in game days.

1How Retries Turned Five Minutes Into an Hour

Picture three layers: a gateway calls an order service, which calls an inventory service. Normal load on inventory is 1,000 requests per second. Inventory fails. Each layer retries 3 times immediately, so one user request becomes up to 3 calls at the order layer and up to 3 x 3 = 9 calls at the inventory layer. Users also press refresh. Inventory now receives perhaps 8,000 requests per second, all arriving in synchronised waves because every caller retries at the same moments.

When inventory restarts, its caches are cold and its connection pools are empty, so it can serve maybe 600 requests per second at first. It meets 8,000 and fails its health checks within seconds. Orchestration restarts it, and the cycle repeats. The original fault was fixed in five minutes; the remaining 55 were caused by our own retries. Seeing this clearly is the first step, because it shows that the fix must cover both the callers and the recovering service.

Step throughRetries multiply at each layer
UserGatewayOrderInventory
GET /order
call 1
call 1, 2, 3 (all fail)
error
retry 2
call 4, 5, 6
retry 3
call 7, 8, 9
user presses refresh

9 messages in order. Play them, or step through them one at a time.

One request became nine calls on the failing service.

2Layer 1: Backoff, Jitter and Few Attempts

Exponential backoff means waiting longer after each failure, for example 200 ms, then 400 ms, then 800 ms, so a failing service gets breathing room. Jitter means randomising each wait, so a thousand callers that failed at the same moment do not all retry at the same moment. Without jitter, backoff still produces synchronised waves. A small maximum, usually 2 or 3 attempts in total, keeps the multiplication bounded. A further rule matters as much: only one layer retries, normally the one closest to the user or the one that owns the operation, and only for errors that may succeed later, such as timeouts or 503, never for 400 or for non-idempotent writes without an idempotency key.

Java
RetryConfig retry = RetryConfig.custom()
.maxAttempts(3) // 1 call + 2 retries
.intervalFunction(IntervalFunction
.ofExponentialRandomBackoff(200, 2.0, 0.5)) // about 200, 400 ms, each +/- 50 percent
.retryOnException(e -> e instanceof TimeoutException
|| e instanceof ServiceUnavailableException)
.build();

3Layer 2: Retry Budgets

Per-request limits are not enough, because when everything fails, every request uses all its retries and traffic still triples. A retry budget limits retries as a share of all traffic from a client, for example "retries may add at most 10 percent on top of first attempts". When the budget is spent, failed calls are returned to the caller without retry. In normal times, when failures are rare, the budget is never reached and retries work as usual. In an outage, the budget caps the extra load at 10 percent instead of 200 percent.

Some service meshes and gRPC support retry budgets or retry throttling directly. In a Java client we can implement one with two counters over a sliding window, requests and retries, and refuse to retry when retries exceed the ratio. The important thing is that the budget lives in the shared library, so all callers of a service obey it the same way.

4Layer 3: Circuit Breakers at Every Caller

A circuit breaker watches the failure rate of calls to one dependency. When it rises above a threshold, say 50 percent over the last 100 calls, the breaker opens, and for the next 30 seconds calls fail immediately without reaching the dependency. Then it moves to half-open and lets a few trial calls through; if they succeed it closes, otherwise it opens again. Resilience4j provides this, and Spring Cloud Circuit Breaker wraps it for Spring Boot.

Java
CircuitBreakerConfig cb = CircuitBreakerConfig.custom()
.failureRateThreshold(50) // open at 50 percent failures
.slidingWindowSize(100) // over the last 100 calls
.waitDurationInOpenState(Duration.ofSeconds(30)) // fail fast for 30 s
.permittedNumberOfCallsInHalfOpenState(10) // then try 10 calls
.build();

The breaker is what turns 8,000 requests per second into almost zero while the dependency is down, and the half-open state is a built-in form of gradual recovery. Callers should also have a fallback for an open breaker, such as a cached answer or a clear degraded response, so users see something better than a timeout.

5Layer 4: The Recovering Service Protects Itself

Even perfect callers cannot help if a new caller misbehaves, so the downstream service must defend itself. It should shed load: when in-flight requests exceed what it can serve, it rejects the excess at once with 503 and a Retry-After header, which costs microseconds, instead of accepting work it will time out on. A concurrency limit (Resilience4j has a Bulkhead, and adaptive limiters exist) does this. It should also admit traffic gradually after a restart. Load balancers can ramp new instances with slow start, and the service can warm caches and connection pools before reporting ready, so the readiness probe only passes when it can actually serve.

So the recovering service serves 600 requests per second well and rejects the rest quickly, rather than serving none of them slowly. As its caches warm, its capacity rises and fewer requests are shed.

6Rolling It Out Across Teams

Writing a guideline is not enough; twenty teams will implement it twenty ways. I would ship the defaults in a shared client library or a service mesh configuration: a preconfigured HTTP client with timeouts, retry with jittered backoff, a retry budget and a circuit breaker, plus metrics for each. Teams that use the standard client get safe behaviour without thinking about it, and overriding the defaults requires a short review.

Then we prove it. In a game day we deliberately take down a dependency in a staging environment, or in production for a small slice of traffic, and watch what callers do: do breakers open, do retries stay within budget, does the service recover in minutes rather than an hour? Each game day produces fixes, and we repeat it regularly, because new services and new library versions arrive all the time.

Step throughDefences from caller to recovering service
  1. Shared client librarytimeouts, retry policy, budget, breaker, metrics
  2. Backoff with jitter2 to 3 attempts, one retrying layer
  3. Retry budgetretries at most 10 percent of traffic
  4. Circuit breakerfail fast while the dependency is down
  5. Load sheddingreject excess fast with 503 and Retry-After
  6. Gradual admissionslow start, warm-up before ready

6 layers, from the top down. Step through them one at a time.

7Follow-up questions

Is it ever right to retry immediately without backoff?

One immediate retry can make sense for a failure that is clearly per-connection, such as a stale pooled connection, because another connection will likely work at once. Even then, it should count against the retry budget. For anything that suggests the server is overloaded, such as timeouts or 503, immediate retries are exactly what causes storms.

How do you get 25 teams to adopt the shared library?

By making it the easiest path and showing evidence. The library comes with the service template, so new services get it automatically. For existing services, we start with the callers of the services that caused the last incidents, show the postmortem numbers, and track adoption on a dashboard. A platform team owns the library and answers questions, which builds the trust that a guideline alone never does.

8Conclusion

In this answer, we saw how retries at several layers multiply load and keep a recovering service down. We built the fix in layers: exponential backoff with jitter and few attempts, a retry budget that caps retries as a share of traffic, circuit breakers so callers stop calling a failing service, and load shedding with gradual admission at the recovering service. Because the problem spans teams, the defaults ship in a shared client library and are proven in regular game days.

What to say in the interviewAbout 100 seconds aloud

Open with

What happened there is a classic retry storm. Each layer retried several times with no delay, so a request multiplied into many calls, and when the downstream service came back it got several times its normal traffic while its caches were cold and fell over again.

Then, if they want more

Since the cause is spread across teams, I would fix it with standard defaults rather than asking each team to be careful. First, a standard retry policy: exponential backoff with jitter so callers do not retry in sync, two or three attempts at most, only on errors that can succeed later, and ideally only one layer retrying.

Second, a retry budget, so retries can only add something like 10 percent to traffic; in an outage that caps the extra load instead of tripling it. Third, circuit breakers at every caller, for example Resilience4j, so when the failure rate crosses a threshold callers fail fast and only send a few trial calls in half-open state.

On the receiving side, the service should protect itself: shed excess load quickly with a 503 and Retry-After, and admit traffic gradually after a restart with slow start and warm-up before it reports ready.

To make this stick, I would put all of it in a shared client library or the mesh configuration that comes with the service template, with metrics, and then run game days where we break a dependency on purpose and check that the outage stays short.

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 official documentation for the version you use. 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 "During an outage, retries from many upstream services overloaded a recovering downstream...": https://scrivio-interview-library.netlify.app/spring-boot/scalability/476007a100/