Day 01 / 30
UPI Retry Storm: How Status Checks Took Down UPI
Retries, backoff and jitterWhat happened
On 12 April 2025, UPI had its longest outage in recent memory, and the cause was not a hack. NPCI said some banks were calling its "Check Transaction Status" API too often and too fast. That flood of status checks slowed the whole system, and reports put the payment success rate below 50%.
The lesson applies to almost every distributed system: every retry is new load.
How a UPI payment flows
Your bank (the remitter) sends the payment through the NPCI switch to the receiver's bank (the beneficiary). If the reply is slow, your bank asks NPCI whether the payment went through. That request is a status check, a form of polling. One or two checks are fine; the trouble starts when every bank polls thousands of times without waiting.
What a retry storm is
A retry storm happens when many clients retry a slow service immediately and repeatedly. Each retry is an extra request, so a service that was only slow now gets more load. It slows further, more requests time out, and more retries arrive: a feedback loop that ends in failure.
- The service slows down and replies arrive late.
- Clients treat the slow reply as a failure and retry at once.
- Traffic doubles or triples, and the service slows further.
- More timeouts cause more retries until the service stops responding.
This is also called a cascading failure or metastable failure: the system stays broken even after the original trigger is gone, because the retries alone keep it overloaded. A close cousin is the thundering herd, where many clients wake at the same instant (for example, on the same fixed timer) and hit the server together.
The fix: exponential backoff with jitter
Wait before each retry, and double the wait every time: 1s, 2s, 4s, 8s. This is exponential backoff. Add a random spread to each wait (jitter) so thousands of clients do not all come back in the same second. Always cap both the wait and the number of attempts.
| Approach | When it retries | Effect on the server |
|---|---|---|
| Immediate retry | 0s, 0s, 0s, 0s | Load multiplies; the service collapses |
| Exponential backoff | 1s, 2s, 4s, 8s | The service gets time to recover |
| Backoff with jitter | random within 1s, 2s, 4s | Retries spread out; no synchronized spikes |
NPCI's new rule (April 2025 circular): the first status check only 90 seconds after the transaction, and at most 3 checks within 2 hours. This is rate limiting enforced by the platform on its clients.
import random, time
def call_with_backoff(request, max_tries=5, base=1.0, cap=30.0):
for attempt in range(max_tries):
try:
return request()
except TimeoutError:
if attempt == max_tries - 1:
raise
wait = min(cap, base * 2 ** attempt) # 1, 2, 4, 8...
time.sleep(random.uniform(0, wait)) # full jitter
One more rule: only retry requests that are idempotent, meaning running them twice has the same effect as running them once (the money moves only once). Idempotency is the Day 06 topic.
Key terms
| Term | Meaning |
|---|---|
| Polling / status check | A client repeatedly asks a server whether a task has finished |
| Timeout | How long a client waits for a reply before giving up |
| Retry storm | Immediate retries against a slow service that multiply its load |
| Thundering herd | Many clients sending requests at the same instant |
| Cascading failure | One overloaded component drags down the components that depend on it |
| Exponential backoff | Doubling the wait before each retry: 1s, 2s, 4s, 8s |
| Jitter | Randomness added to the wait so retries do not line up |
| Retry budget | A cap on retries as a share of total traffic, e.g. at most 10% |
| Rate limiting | A cap on how many requests a client may send in a time window |
| Idempotency | Running a request twice has the same effect as running it once |
Interview questions to practise
- Design the retry logic for a payment API client. When should it retry, and when must it never retry?
- Why does adding jitter help, even though it makes each wait less predictable?
- A service recovers, but traffic keeps it down. What is happening, and how do you break the loop?
- Polling vs webhooks (callbacks): what are the trade-offs for checking a payment's status?
- How would you rate-limit clients of a shared platform like a UPI switch?