Retry politely: retryable failures only, exponential backoff, jitter, honour Retry-After, cap attempts. Naive immediate retry = DDoS-yourself.
Разбор
Networks fail transiently — retry masks blips. But retries amplify load on struggling server. Art: enough retry for blips, not retry storm.
❌ Naive: fail → retry now → fail → retry now → fail … (all clients in lockstep = DDoS-yourself)
✅ Backoff: fail → wait 1s → fail → wait 2s → fail → wait 4s … (exponential, capped)
✅ +Jitter: fail → wait rand(0..1s) → wait rand(0..2s) … (spreads the herd out)
Exponential backoff — server room to recover. Jitter — thousand clients don't retry same instant.
Итог
Two ideas: exponential wait + random spread — mandatory for production client resilience.