Menu

Reddit - Please wait for verification
📰
0

Reddit - Please wait for verification

The Go Programming Language·/u/kkumar-gcc·3 days ago
#TygFpNX0
Reading 0:00
15s threshold

Hey everyone, I wrote a post about something I see trip people up a lot: naive HTTP retries. Usually, we just throw a for loop and a time.Sleep() at a failing API call and move on. But that standard approach secretly causes a lot of headaches in Go. It silently consumes the request body so retries are empty, ignores context cancellation, and hardcoded sleeps just create thundering herds that hammer recovering servers. I walked through fixing these step-by-step (exponential backoff, full jitter, mocked sleepers) so we can understand what battle-tested libraries like go-retryablehttp are actually doing under the hood. Would love to hear your thoughts or if I missed any edge cases! Link: Retrying HTTP Requests in Go Without Making It Worse submitted by /u/kkumar-gcc [link] [comments]

Read More