Skip to content

Commit 63d09e3

Browse files
authored
Merge pull request #218 from cosmtrek/fix_issue_linux
fix no such process issue in linux
2 parents 53fb783 + a2410be commit 63d09e3

File tree

1 file changed

+9
-4
lines changed

1 file changed

+9
-4
lines changed

runner/util_linux.go

+9-4
Original file line numberDiff line numberDiff line change
@@ -19,11 +19,16 @@ func (e *Engine) killCmd(cmd *exec.Cmd) (pid int, err error) {
1919
time.Sleep(e.config.Build.KillDelay * time.Millisecond)
2020
}
2121

22-
// https://stackoverflow.com/questions/22470193/why-wont-go-kill-a-child-process-correctly
23-
err = syscall.Kill(-pid, syscall.SIGKILL)
24-
22+
err = killByPid(pid)
23+
if err != nil {
24+
return pid, err
25+
}
2526
// Wait releases any resources associated with the Process.
26-
_, _ = cmd.Process.Wait()
27+
_, err = cmd.Process.Wait()
28+
if err != nil {
29+
return pid, err
30+
}
31+
e.mainDebug("killed process pid %d successed", pid)
2732
return
2833
}
2934

0 commit comments

Comments
 (0)