syncd icon indicating copy to clipboard operation
syncd copied to clipboard

/bin/bash封装疑似goroutine泄露

Open buexplain opened this issue 4 years ago • 1 comments

代码:util/command/command.go 问题:Command对象的Run方法,goroutine泄露 描述:假设命令执行超时,那么Run方法退出,不再select变量errChan,此后命令执行结束或者被kill掉了,此时这行代码errChan <- c.command.Wait()岂不是阻塞住了。 我没有测试这块代码。

buexplain avatar Jul 15 '19 09:07 buexplain

可参考,https://golang.org/src/os/exec/exec.go#L380,https://golang.org/src/os/exec/exec.go#L482

dreamans avatar Jul 15 '19 11:07 dreamans