Possible blocking on waitCh
c0494133d4 opened this issue · 1 comments
c0494133d4 commented
func onError() {
...
e.waitCh <- &drivers.ExitResult
}
waitCh is defined as
func newDtleTaskHandle() {
waitCh: make(chan *drivers.ExitResult, 1),
}
and read only once
func handleWait() {
case result := <-handle.waitCh:
}
A concurrent call to onError
might block on waitCh forever.
ffffwh commented
StopTask() vs DestroyTask()
- 主动
nomad job stop
时,先调用StopTask再调用DestroyTask - 任务报错退出时,只调用DestroyTask
目前两者都调用了handle.Destroy(), 待review。