From 9b6e1b4dafbfcad0511eeb9f70f4f707a51b2416 Mon Sep 17 00:00:00 2001 From: Michael Crosby Date: Thu, 8 Oct 2015 16:54:41 -0700 Subject: [PATCH] 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. --- client/executor/exec_linux.go | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/client/executor/exec_linux.go b/client/executor/exec_linux.go index 3985fb5fe..7a64b9e69 100644 --- a/client/executor/exec_linux.go +++ b/client/executor/exec_linux.go @@ -542,6 +542,11 @@ func (e *LinuxExecutor) destroyCgroup() error { multierror.Append(errs, fmt.Errorf("Failed to kill Pid %v: %v", pid, err)) continue } + + if _, err := process.Wait(); err != nil { + multierror.Append(errs, fmt.Errorf("Failed to wait Pid %v: %v", pid, err)) + continue + } } // Remove the cgroup.