Skip to content

Commit 2096604

Browse files
authored
Merge pull request containerd#10523 from k8s-infra-cherrypick-robot/cherry-pick-10442-to-release/1.7
[release/1.7] client: fix tasks with PID 0 cannot be forced to delete
2 parents 54b9c74 + 0db46f6 commit 2096604

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

Diff for: task_opts.go

+6
Original file line numberDiff line numberDiff line change
@@ -158,6 +158,12 @@ type ProcessDeleteOpts func(context.Context, Process) error
158158

159159
// WithProcessKill will forcefully kill and delete a process
160160
func WithProcessKill(ctx context.Context, p Process) error {
161+
// Skip killing tasks with PID 0
162+
// https://github.com/containerd/containerd/issues/10441
163+
if p.Pid() == 0 {
164+
return nil
165+
}
166+
161167
ctx, cancel := context.WithCancel(ctx)
162168
defer cancel()
163169
// ignore errors to wait and kill as we are forcefully killing

0 commit comments

Comments
 (0)