From 9cb2ed10d27fbb13c958c4d2abc02409562b5923 Mon Sep 17 00:00:00 2001 From: mckelvin Date: Wed, 8 Mar 2017 16:41:58 +0800 Subject: [PATCH] Fix zombie processes by calling Wait after Command.Run --- api/tasks/runner.go | 3 +++ 1 file changed, 3 insertions(+) diff --git a/api/tasks/runner.go b/api/tasks/runner.go index 1ec420ae5..a42c752e0 100644 --- a/api/tasks/runner.go +++ b/api/tasks/runner.go @@ -253,6 +253,7 @@ func (t *task) updateRepository() error { } t.logCmd(cmd) + defer cmd.Wait() return cmd.Run() } @@ -277,6 +278,7 @@ func (t *task) runGalaxy() error { } t.logCmd(cmd) + defer cmd.Wait() return cmd.Run() } @@ -327,6 +329,7 @@ func (t *task) runPlaybook() error { cmd.Env = t.envVars(util.Config.TmpPath, cmd.Dir, nil) t.logCmd(cmd) + defer cmd.Wait() return cmd.Run() }