Retry storm debugging lab. Order confirmation emails stopped going out. The provider says we send far over our quota, yet orders are at their usual rate.
Practice debugging a retry storm in a live, broken production system in your browser, with PostgreSQL and HTTP API. Find the root cause in the logs, terminal and code, fix it, and a load test checks that the fix holds under real traffic.
1. The Incident Context
Order confirmation emails stopped going out at 13:05, right after a short blip at our email provider. The provider says our account is being rate-limited because we send far above our quota of 100 requests per second. Our order volume is normal, and the provider's status page is green again.
2. Observed Symptoms & Metrics
- Affected Endpoints / Components:
POST /notifications and the notify worker in the notifications service, the email provider at localhost:9101/send, Postgres notifications table.
- Behavior: About 40 notifications per second enter the queue. Since the blip, the provider sees around 200 requests per second from us, and it answers almost all of them with
429. The provider's own status is healthy, yet the number of emails sent has dropped to zero and stays there.
- Error Rate: Nearly every call to the provider returns
429 Too Many Requests. Notifications marked failed after 5 attempts keep piling up.
- System Metrics: The worker is busy even though it gets almost nothing done. Postgres is healthy.
3. Application Logs
2026/10/12 13:05:00 notify worker started, concurrency=20
2026/10/12 13:05:03 send order-881: 429 Too Many Requests, retrying (attempt 2)
2026/10/12 13:05:03 send order-881: 429 Too Many Requests, retrying (attempt 3)
2026/10/12 13:05:03 send order-881: 429 Too Many Requests, retrying (attempt 4)
2026/10/12 13:05:03 send order-881: 429 Too Many Requests, retrying (attempt 5)
2026/10/12 13:05:03 send order-881: giving up after 5 attempts
# curl localhost:9101/stats
{"requests_per_sec":203,"accepted_per_sec":0,"rejected_429_per_sec":203,"rejected_503_per_sec":0,"quota_per_sec":100,"throttled":true,"outage":false,"total_accepted":5126}
4. Your Objective
Step into the live environment while synthetic traffic is running, find the root cause, and patch the code.
To clear this stack, your fix must pass these checks under a 60-second load test at 40 notifications per second, with the provider capped at 100 req/s and a 10-second hard outage in the middle:
- Delivery: At least 99% of the notifications created during the test are sent within 30 seconds of the test ending (
undelivered_ratio <= 0.01).
- Politeness: The provider never sees more than 110 requests in any one second (
provider_peak_rps <= 110).
- Data Integrity: No email is sent more than once (
duplicate_sends == 0), and fewer than 1% of POST /notifications requests fail (http_errors < 1%).
Toolbox: curl localhost:9101/stats, curl -X POST localhost:9101/chaos -d '{"outageSeconds": 10}', psql "$DATABASE_URL" -c "SELECT status, count(*) FROM notifications GROUP BY 1", curl -X POST localhost:8080/notifications -H 'Content-Type: application/json' -d '{"orderId": "order-1", "email": "a@example.com"}'. Save a file in the editor to rebuild and restart the app. Click Verify when you think it's fixed.
Terms in this lab: req/s (requests per second), quota (how many requests the provider allows per second), 429 (Too Many Requests), 503 (Service Unavailable), worker (the background loop that sends the emails).
You can browse stacks without an account. To run labs you sign in with your email or Google account. BustedStack uses your email address to
sign you in, and your name and profile picture to show your account and pre-fill certificates. We never access your Gmail, contacts or Drive,
sell your data or run ad trackers.
This site needs JavaScript to run labs.