Backoff and Retry
Retry with backoff.
Why Retry
Transient failures, timeouts, dropped connections, brief 503s, often succeed on a second attempt. Retrying turns a flaky operation into a reliable one without bothering the caller.
Naive Retry Is Dangerous
Retrying immediately in a tight loop hammers a struggling service and can cause a retry storm. We need delays between attempts, and the delays should grow.
All lessons in this course
- Token Bucket Concept
- golang.org/x/time/rate
- Throttling Goroutines
- Backoff and Retry