Skip to content

Commit 9b6e1b4

Browse files
committed
Reap process after sending kill signal
Without waiting on the process after sending a kill will cause zombies and we all know what happens when we have a zombies outbreak. There are other calls to kill in this file but they are done on the main process for the task so they should have the wait method called at sometime in their lifecycle.
1 parent ae6829c commit 9b6e1b4

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

client/executor/exec_linux.go

+5
Original file line numberDiff line numberDiff line change
@@ -542,6 +542,11 @@ func (e *LinuxExecutor) destroyCgroup() error {
542542
multierror.Append(errs, fmt.Errorf("Failed to kill Pid %v: %v", pid, err))
543543
continue
544544
}
545+
546+
if _, err := process.Wait(); err != nil {
547+
multierror.Append(errs, fmt.Errorf("Failed to wait Pid %v: %v", pid, err))
548+
continue
549+
}
545550
}
546551

547552
// Remove the cgroup.

0 commit comments

Comments
 (0)