From b8a2cd9f407a59f1e457a2ea939060c3881b7e1a Mon Sep 17 00:00:00 2001 From: zeripath Date: Thu, 17 Dec 2020 20:06:51 +0000 Subject: [PATCH] Always wait for the cmd to finish (#14006) (#14039) Backport #14006 After cancelling the context we still need to wait for the command to finish otherwise zombie processes may occur Fix #13987 --- modules/git/command.go | 1 + 1 file changed, 1 insertion(+) diff --git a/modules/git/command.go b/modules/git/command.go index d40c0bfa232..c9d17324168 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 } }