Skip to content

Commit db82213

Browse files
committed
Make sure that process.Manager.Kill() cancels
1 parent ca90bea commit db82213

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

modules/process/manager.go

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -156,6 +156,9 @@ func (pm *Manager) ExecDirEnvStdIn(timeout time.Duration, dir, desc string, env
156156
func (pm *Manager) Kill(pid int64) error {
157157
if proc, exists := pm.Processes[pid]; exists {
158158
pm.mutex.Lock()
159+
if proc.Cancel != nil {
160+
proc.Cancel()
161+
}
159162
if proc.Cmd != nil &&
160163
proc.Cmd.Process != nil &&
161164
proc.Cmd.ProcessState != nil &&

0 commit comments

Comments
 (0)