syncd
syncd copied to clipboard
/bin/bash封装疑似goroutine泄露
代码:util/command/command.go
问题:Command对象的Run方法,goroutine泄露
描述:假设命令执行超时,那么Run方法退出,不再select
变量errChan
,此后命令执行结束或者被kill掉了,此时这行代码errChan <- c.command.Wait()
岂不是阻塞住了。
我没有测试这块代码。
可参考,https://golang.org/src/os/exec/exec.go#L380,https://golang.org/src/os/exec/exec.go#L482