Does my channel buffer size choice hide backpressure problems, and how do I decide it?
Keep channel capacity near the worker count, let blocking propagate to the Kafka poll loop, and when consumer lag climbs grow workers, not the buffer.
Tag
Concurrent execution: goroutines, channels, locks and taming race conditions. questions under this tag, answered directly.
5 answered questions carry this tag.
Keep channel capacity near the worker count, let blocking propagate to the Kafka poll loop, and when consumer lag climbs grow workers, not the buffer.
Stay in FPM and start with a Guzzle Pool pinned to 20-50 concurrency; move to AMPHP v3 only if the codebase grows async, Swoole only when re-architecting.
Move to `errgroup.WithContext` with a request-level timeout on top and thread ctx into every HTTP and DB call; an ignored ctx means no cancellation at all.
Cancellation propagates only if you pass `r.Context()` into every downstream call, leave no `context.Background()` in the chain, and use `WithoutCancel`.
Export NumGoroutine() as a metric, take a pprof goroutine dump at peak, make the spawn site behind the parked stacks honor ctx.Done(), then add goleak.