From 80a299d307bd3135eb3fb2f5e2deba600f0698ae Mon Sep 17 00:00:00 2001 From: zeripath Date: Thu, 17 Dec 2020 11:50:21 +0000 Subject: [PATCH] Always wait for the cmd to finish (#14006) After cancelling the context we still need to wait for the command to finish otherwise zombie processes may occur Fix #13987 Signed-off-by: Andrew Thornton Co-authored-by: 6543 <6543@obermui.de> --- modules/git/command.go | 1 + 1 file changed, 1 insertion(+) diff --git a/modules/git/command.go b/modules/git/command.go index d40c0bfa2..c9d173241 100644 --- a/modules/git/command.go +++ b/modules/git/command.go @@ -153,6 +153,7 @@ func (c *Command) RunInDirTimeoutEnvFullPipelineFunc(env []string, timeout time. err := fn(ctx, cancel) if err != nil { cancel() + _ = cmd.Wait() return err } }