mirror of
https://github.com/go-ping/ping.git
synced 2025-04-27 18:35:12 +00:00
Deadlock fix (#85)
Deadlock observed when starting multiple ping routines. It happens when writting to `recv` channel (which is full) and no active readers for this channel. *Example to reproduce the issue* : var waiter sync.WaitGroup pingFunc := func() { defer waiter.Done() pinger, err := ping.NewPinger("8.8.8.8") if err != nil { return } pinger.SetPrivileged(true) pinger.Count = 5 pinger.Interval = time.Second pinger.Timeout = time.Second * 4 pinger.Run() } for i := 0; i < 1000; i++ { waiter.Add(1) go pingFunc() } waiter.Wait() // deadlock here! (reproducible almost every time)
This commit is contained in:
parent
e8ae07c3ce
commit
70ede2ab32
Loading…
Reference in New Issue
Block a user