0069-containerd-add-check-in-spec.patch 0070-containerd-kill-container-init-process-if-runc-start.patch 0071-containerd-fix-containerd-shim-residual-when-kill-co.patch 0072-containerd-fix-deadlock-on-commit-error.patch 0073-containerd-backport-upstream-patches.patch 0074-containerd-fix-exec-event-missing-due-to-pid-reuse.patch 0075-containerd-fix-dm-left-when-pause-contaienr-and-kill-shim.patch 0076-containerd-fix-start-container-failed-with-id-exists.patch 0077-containerd-drop-opt-package.patch 0078-containerd-bump-containerd-ttrpc-699c4e40d1.patch 0079-containerd-fix-race-access-for-mobySubcribed.patch 0080-containerd-improve-log-for-debugging.patch 0081-containerd-reduce-permissions-for-bundle-di.patch 0082-containerd-fix-publish-command-wait-block-for.patch 0083-containerd-optimize-cgo-compile-options.patch Signed-off-by:songyanting <songyanting@huawei.com>
37 lines
1.2 KiB
Diff
37 lines
1.2 KiB
Diff
From c10041fa37568bca00a25c055ee844d38e91fa95 Mon Sep 17 00:00:00 2001
|
|
From: chenjiankun <chenjiankun1@huawei.com>
|
|
Date: Mon, 19 Apr 2021 17:08:09 +0800
|
|
Subject: [PATCH] docker: fix dm left when pause contaienr and kill shim
|
|
|
|
when shim process be killed, we will delete the runtime, but if the
|
|
status is paused, it can't be delete. So we need to resume the shim
|
|
process before delete it.
|
|
---
|
|
runtime/v1/linux/runtime.go | 10 ++++++++++
|
|
1 file changed, 10 insertions(+)
|
|
|
|
diff --git a/runtime/v1/linux/runtime.go b/runtime/v1/linux/runtime.go
|
|
index 66f959d..ca36748 100644
|
|
--- a/runtime/v1/linux/runtime.go
|
|
+++ b/runtime/v1/linux/runtime.go
|
|
@@ -541,6 +541,16 @@ func (r *Runtime) terminate(ctx context.Context, bundle *bundle, ns, id string)
|
|
}
|
|
|
|
if !legacy.IsLegacy(id) || legacy.IsSamePid(id) {
|
|
+
|
|
+ state, err := rt.State(ctx, id)
|
|
+ if err == nil && state.Status == "paused" {
|
|
+ logrus.Warnf("container %s status is paused, try to resume before delete", id)
|
|
+ err := rt.Resume(ctx, id)
|
|
+ if err != nil {
|
|
+ log.G(ctx).WithError(err).Errorf("runtime resume %s error", id)
|
|
+ }
|
|
+ }
|
|
+
|
|
if err := rt.Delete(ctx, id, &runc.DeleteOpts{
|
|
Force: true,
|
|
}); err != nil {
|
|
--
|
|
2.23.0
|
|
|