From af535233ccdf4b47126705ecb59fbd975ff603f8 Mon Sep 17 00:00:00 2001 From: Sebastiaan van Stijn Date: Mon, 14 Aug 2023 16:15:07 +0200 Subject: [PATCH] daemon: Daemon.killWithSignal(): don't discard handleContainerExit error Daemon.handleContainerExit() returns an error if snapshotting the container's state to disk fails. There's not much we can do with the error if it occurs, but let's log the error if that happens, instead of discarding it. Signed-off-by: Sebastiaan van Stijn --- daemon/kill.go | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/daemon/kill.go b/daemon/kill.go index e91a0ce8d6..4cc7b58dcd 100644 --- a/daemon/kill.go +++ b/daemon/kill.go @@ -111,7 +111,13 @@ func (daemon *Daemon) killWithSignal(container *containerpkg.Container, stopSign defer cancel() s := <-container.Wait(ctx, containerpkg.WaitConditionNotRunning) if s.Err() != nil { - daemon.handleContainerExit(container, nil) + if err := daemon.handleContainerExit(container, nil); err != nil { + log.G(context.TODO()).WithFields(log.Fields{ + "error": err, + "container": container.ID, + "action": "kill", + }).Warn("error while handling container exit") + } } }() } else {