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
commit eb67aa5960
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -134,7 +134,7 @@ func (c *criService) execInContainer(ctx context.Context, id string, opts execOp
defer func() {
deferCtx, deferCancel := ctrdutil.DeferContext()
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)
}
}()