fix(process): reap entire process group on cmd.Cancel (#39143)

Signed-off-by: Royce Remer <royceremer@gmail.com>
Co-authored-by: wxiaoguang <wxiaoguang@gmail.com>
This commit is contained in:
Royce Remer
2026-08-29 19:54:07 +00:00
committed by GitHub
co-authored by wxiaoguang
parent 88974d2db9
commit eea03676d3
21 changed files with 198 additions and 203 deletions
+1 -3
View File
@@ -75,7 +75,7 @@ func sessionHandler(session *sshSession) int {
}
}
cmd := exec.CommandContext(ctx, setting.AppPath, args...)
cmd := process.CommandContext(ctx, setting.AppPath, args...)
cmd.Env = append(
os.Environ(),
"SSH_ORIGINAL_COMMAND="+session.rawCmd,
@@ -104,8 +104,6 @@ func sessionHandler(session *sshSession) int {
}
defer stdin.Close()
process.SetSysProcAttribute(cmd)
wg := &sync.WaitGroup{}
if err = cmd.Start(); err != nil {