Skip to content
This repository was archived by the owner on May 12, 2021. It is now read-only.

Commit c08976e

Browse files
author
Julio Montes
authored
Merge pull request #1494 from lifupan/fixstop
shimv2: fix the issue of stop container failed
2 parents dd5c6aa + f7223c6 commit c08976e

File tree

1 file changed

+1
-13
lines changed

1 file changed

+1
-13
lines changed

containerd-shim-v2/service.go

Lines changed: 1 addition & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -634,19 +634,7 @@ func (s *service) Kill(ctx context.Context, r *taskAPI.KillRequest) (*ptypes.Emp
634634
processID = execs.id
635635
}
636636

637-
err = s.sandbox.SignalProcess(c.id, processID, signum, r.All)
638-
if err != nil {
639-
return nil, err
640-
}
641-
642-
// Since the k8s will use the SIGTERM signal to stop a container by default, but
643-
// some container processes would ignore this signal such as shell, thus it's better
644-
// to resend another SIGKILL signal to make sure the container process terminated successfully.
645-
if signum == syscall.SIGTERM {
646-
err = s.sandbox.SignalProcess(c.id, processID, syscall.SIGKILL, r.All)
647-
}
648-
649-
return empty, err
637+
return empty, s.sandbox.SignalProcess(c.id, processID, signum, r.All)
650638
}
651639

652640
// Pids returns all pids inside the container

0 commit comments

Comments
 (0)