Technical detail · Operational Failure Modes
How the retry window spreads recovery traffic
7.4.3 Retry Pattern
Use the pattern, not the exact constants, as the review target:
import random
import time
def retry_delay(base, attempt, cap):
window = min(cap, base * 2 ** attempt)
return random.uniform(0, window)
def send_with_backoff(send_once, attempts=8):
base = 1.0
cap = 60.0
for attempt in range(attempts):
try:
return send_once()
except NetworkError:
time.sleep(retry_delay(base, attempt, cap))
raise RetryBudgetExhausted()
Full jitter means the retry is sampled from the whole current backoff window. Equal jitter keeps a minimum delay and samples from only the upper half of the window. Either is better than no jitter, but a large fleet usually needs maximum spreading during mass recovery.
The example allows 8 attempts, starts with a 1.0-second base, and caps the window at 60.0 seconds. Review these bounds for the workload rather than copying them unchanged. AWS Architecture Blog’s Exponential Backoff and Jitter provides the retry reference.