Make sure exec process is killed when context is canceled.
Signed-off-by: Lantao Liu <lantaol@google.com>
This commit is contained in:
parent
ac9f8e1c4d
commit
d257c16dbc
@ -134,7 +134,7 @@ func (c *criService) execInContainer(ctx context.Context, id string, opts execOp
|
|||||||
defer func() {
|
defer func() {
|
||||||
deferCtx, deferCancel := ctrdutil.DeferContext()
|
deferCtx, deferCancel := ctrdutil.DeferContext()
|
||||||
defer deferCancel()
|
defer deferCancel()
|
||||||
if _, err := process.Delete(deferCtx); err != nil {
|
if _, err := process.Delete(deferCtx, containerd.WithProcessKill); err != nil {
|
||||||
logrus.WithError(err).Errorf("Failed to delete exec process %q for container %q", execID, id)
|
logrus.WithError(err).Errorf("Failed to delete exec process %q for container %q", execID, id)
|
||||||
}
|
}
|
||||||
}()
|
}()
|
||||||
|
Loading…
Reference in New Issue
Block a user