Skip to content

Commit 98b5eb4

Browse files
authored
Merge pull request containerd#10524 from k8s-infra-cherrypick-robot/cherry-pick-10442-to-release/1.6
[release/1.6] client: fix tasks with PID 0 cannot be forced to delete
2 parents 881a788 + 5c88187 commit 98b5eb4

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

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)