Unbounded goroutines are the default failure: ten thousand shards means ten thousand concurrent connections and an immediate rate limit. The semaphore pattern, the context that makes cancellation propagate, and the two mistakes that produce a leak nothing reports.
In Go, download many model shards concurrently with a concurrency limit, a timeout and clean cancellation. Write it.
Unbounded goroutines are the default failure: ten thousand shards means ten thousand concurrent connections and an immediate rate limit. The semaphore pattern, the context that makes cancellation propagate, and the two mistakes that produce a leak nothing reports.
Updated Sep 2026 · Grounded in real AI infrastructure interview loops and written to a senior-engineer editorial bar, with every number worked and every diagram hand-built.
The concepts behind this question
Ranked by how closely each one overlaps this question's topic, so the first card is the thing to read if the answer above moved too fast.
Scored on a buffered channel as the semaphore, on context propagation for cancellation and timeouts, on the loop-variable capture and the goroutine leak, and on returning the first error while letting the rest finish.
No comments yet — be the first to share your approach.
