Published on: 2025-06-11 10:43:14
Exponential backoff with jitter is de rigeur for making service calls. This code, or something like it, probably looks really familiar: func do(ctx context.Context) error { const ( maxAttempts = 10 baseDelay = 1 * time.Second maxDelay = 60 * time.Second ) delay := baseDelay for attempt := range maxAttempts { err := request(ctx) if err == nil { return nil } delay *= 2 delay = min(delay, maxDelay) jitter := multiplyDuration(delay, rand.Float64()*0.5-0.25) // ±25% sleepTime := delay + jitter selec
Keywords: ctx delay return second time
Find related items on AmazonPublished on: 2025-07-17 22:59:25
This adventures starts with a simple eBPF program to transparently redirect DNS requests on port 53 for a single program (or docker container). To do this I used BPF_CGROUP_INET4_CONNECT on a cgroup . That lets me inspect and redirect traffic when syscall.connect occurs from within the cgroup . Here is a simplified version 👇 int handle_connect_redirect ( struct bpf_sock_addr * ctx , __be32 original_ip , bool is_connect4 , struct redirect_result * result ) { __be32 new_ip = original_ip ; __be16
Keywords: address ctx ebpf ipv4 ipv6
Find related items on AmazonGo K’awiil is a project by nerdhub.co that curates technology news from a variety of trusted sources. We built this site because, although news aggregation is incredibly useful, many platforms are cluttered with intrusive ads and heavy JavaScript that can make mobile browsing a hassle. By hand-selecting our favorite tech news outlets, we’ve created a cleaner, more mobile-friendly experience.
Your privacy is important to us. Go K’awiil does not use analytics tools such as Facebook Pixel or Google Analytics. The only tracking occurs through affiliate links to amazon.com, which are tagged with our Amazon affiliate code, helping us earn a small commission.
We are not currently offering ad space. However, if you’re interested in advertising with us, please get in touch at [email protected] and we’ll be happy to review your submission.