From 54eba28760754605d6edec29bbd2c9f185ae79f7 Mon Sep 17 00:00:00 2001 From: gosoon Date: Sun, 28 Aug 2022 20:06:22 +0800 Subject: [PATCH] fix: checkpoint error when destroy container --- checkpoint.go | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/checkpoint.go b/checkpoint.go index 7597e552df9..b4bc62af622 100644 --- a/checkpoint.go +++ b/checkpoint.go @@ -69,7 +69,11 @@ checkpointed.`, if !(options.LeaveRunning || options.PreDump) { // destroy container unless we tell CRIU to keep it - defer destroy(container) + defer func() { + if err := killContainer(container); err != nil { + logrus.Error(err) + } + }() } // these are the mandatory criu options for a container if err := setPageServer(context, options); err != nil {