Skip to content

Commit 25e6f53

Browse files
committed
Set WaitDelay on the git command
So we don't wait indefinitely for the git command to finish after we send the sigterm signal to it on context cancel.
1 parent 5bd8ddd commit 25e6f53

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

pkg/mirror/helper.go

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -200,6 +200,8 @@ func runGitCommand(ctx context.Context, log *slog.Logger, envs []string, cwd str
200200
log.Log(ctx, -8, "running command", "cwd", cwd, "cmd", cmdStr)
201201

202202
cmd := exec.CommandContext(ctx, gitExecutablePath, args...)
203+
// force kill git 5 seconds after sending it sigterm
204+
cmd.WaitDelay = 5 * time.Second
203205
if cwd != "" {
204206
cmd.Dir = cwd
205207
}

0 commit comments

Comments
 (0)