From ddf7f01876f976b6f4ef477718214289274728ea Mon Sep 17 00:00:00 2001 From: Giuseppe Scrivano Date: Thu, 2 Jul 2020 16:29:37 +0200 Subject: [PATCH] linux: skip errors from the runtime kill fix a race condition where the container process could exit before the runtime sends the signal, causing the command to fail. Part of: https://github.com/containers/crun/issues/422 Signed-off-by: Giuseppe Scrivano --- run_linux.go | 9 ++------- 1 file changed, 2 insertions(+), 7 deletions(-) diff --git a/run_linux.go b/run_linux.go index 44f1cfa96f8..c70783f8c46 100644 --- a/run_linux.go +++ b/run_linux.go @@ -841,13 +841,8 @@ func runUsingRuntime(isolation Isolation, options RunOptions, configureNetwork b stopped := false defer func() { if !stopped { - err2 := kill.Run() - if err2 != nil { - if err == nil { - err = errors.Wrapf(err2, "error stopping container") - } else { - logrus.Infof("error stopping container: %v", err2) - } + if err2 := kill.Run(); err2 != nil { + logrus.Infof("error stopping container: %v", err2) } } }()