Prevent StateFailed after SIGKILL (#129)

Closes #125
This commit is contained in:
Benson Wong
2025-05-14 10:47:35 -07:00
committed by GitHub
parent 7f37bcc6eb
commit 25f251699c

View File

@@ -214,6 +214,12 @@ func (p *Process) start() error {
go func() {
exitErr := p.cmd.Wait()
p.proxyLogger.Debugf("<%s> cmd.Wait() returned error: %v", p.ID, exitErr)
// there is a race condition when SIGKILL is used, p.cmd.Wait() returns, and then
// the code below fires, putting an error into cmdWaitChan. This code is to prevent this
if exitErr != nil && exitErr.Error() == "signal: killed" {
return
}
p.cmdWaitChan <- exitErr
}()