Skip to content

Commit

Permalink
Make raw_exec processes cleanup function more precise.
Browse files Browse the repository at this point in the history
  • Loading branch information
emate committed Feb 6, 2018
1 parent 2ba6aee commit 9b5bcd6
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions client/driver/executor/executor.go
Original file line number Diff line number Diff line change
Expand Up @@ -450,7 +450,7 @@ func ClientCleanup(ic *dstructs.IsolationConfig, pid int) error {
}

// Cleanup any still hanging user processes
func (e *UniversalExecutor) cleanupUserLeftovers(proc *os.Process) error {
func (e *UniversalExecutor) cleanupChildProcesses(proc *os.Process) error {
// If new process group was created upon command execution
// we can kill the whole process group now to cleanup any leftovers.
if e.cmd.SysProcAttr != nil && e.cmd.SysProcAttr.Setpgid {
Expand Down Expand Up @@ -490,7 +490,7 @@ func (e *UniversalExecutor) Exit() error {
if err != nil {
e.logger.Printf("[ERR] executor: can't find process with pid: %v, err: %v",
e.cmd.Process.Pid, err)
} else if err := e.cleanupUserLeftovers(proc); err != nil && err.Error() != finishedErr {
} else if err := e.cleanupChildProcesses(proc); err != nil && err.Error() != finishedErr {
merr.Errors = append(merr.Errors,
fmt.Errorf("can't kill process with pid: %v, err: %v", e.cmd.Process.Pid, err))
}
Expand Down

0 comments on commit 9b5bcd6

Please sign in to comment.