Rewrite multiChannelNodeConn.send() to use a two-phase approach: 1. RLock: snapshot connections slice (cheap pointer copy) 2. Unlock: send to all connections (50ms timeouts happen here) 3. Lock: remove failed connections by pointer identity Previously, send() held the write lock for the entire duration of sending to all connections. With N stale connections each timing out at 50ms, this blocked addConnection/removeConnection for N*50ms. The two-phase approach holds the lock only for O(N) pointer operations, not for N*50ms I/O waits. |
||
|---|---|---|
| .. | ||
| batcher.go | ||
| batcher_bench_test.go | ||
| batcher_concurrency_test.go | ||
| batcher_lockfree.go | ||
| batcher_test.go | ||
| batcher_unit_test.go | ||
| builder.go | ||
| builder_test.go | ||
| mapper.go | ||
| mapper_test.go | ||
| tail_test.go | ||