mirror of
https://github.com/chainreactors/spray.git
synced 2026-10-29 03:50:47 +00:00
When ctx is cancelled (e.g. IsFailed threshold), the Run loop breaks and stops reading additionCh. But doCheck (now via addAddition) may have queued items with wg.Add(1) that no one consumes. Close().wg.Wait() hangs forever. Fix: spawn a drain goroutine in Close() before wg.Wait() that consumes and Done()s remaining additionCh items, then close the channel after Wait returns. Verified: 16 IPs x 2 ports x 1000 words completes with EXIT 0. Co-Authored-By: Claude Opus 4.6 (1M context) <[email protected]>