event, p2p/simulations/adapters: fix rare goroutine leaks (#20657)

Co-authored-by: Felix Lange <fjl@twurst.com>
This commit is contained in:
Boqin Qin
2020-02-12 22:19:47 +08:00
committed by GitHub
parent 46c4b699c8
commit a9614c3c91
3 changed files with 10 additions and 11 deletions

View File

@ -287,7 +287,7 @@ func (n *ExecNode) Stop() error {
if err := n.Cmd.Process.Signal(syscall.SIGTERM); err != nil {
return n.Cmd.Process.Kill()
}
waitErr := make(chan error)
waitErr := make(chan error, 1)
go func() {
waitErr <- n.Cmd.Wait()
}()