Skip to content
This repository was archived by the owner on Mar 9, 2022. It is now read-only.

Commit 7a5e210

Browse files
committed
Make sure exec process is killed when context is canceled.
Signed-off-by: Lantao Liu <[email protected]>
1 parent cdbb238 commit 7a5e210

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

pkg/server/container_execsync.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -131,7 +131,7 @@ func (c *criService) execInContainer(ctx context.Context, id string, opts execOp
131131
defer func() {
132132
deferCtx, deferCancel := ctrdutil.DeferContext()
133133
defer deferCancel()
134-
if _, err := process.Delete(deferCtx); err != nil {
134+
if _, err := process.Delete(deferCtx, containerd.WithProcessKill); err != nil {
135135
logrus.WithError(err).Errorf("Failed to delete exec process %q for container %q", execID, id)
136136
}
137137
}()

0 commit comments

Comments
 (0)