Merge pull request #1156 from Random-Liu/make-sure-exec-kill

Make sure exec process is killed when context is canceled.
This commit is contained in:
Mike Brown
2019-05-29 23:22:51 +02:00
committed by GitHub

View File

@@ -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)
} }
}() }()