daemon: Daemon.killWithSignal(): don't discard snapshotting errors

While there's not much we can do if we failed to store a snapshot of the
container's state, let's log the error in case it happens in stad of discarding.

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
This commit is contained in:
Sebastiaan van Stijn 2023-08-14 16:17:09 +02:00
parent af535233cc
commit b9f9e20f01
No known key found for this signature in database
GPG key ID: 76698F39D527CE8C

View file

@ -87,7 +87,12 @@ func (daemon *Daemon) killWithSignal(container *containerpkg.Container, stopSign
if !daemon.IsShuttingDown() {
container.HasBeenManuallyStopped = true
container.CheckpointTo(daemon.containersReplica)
if err := container.CheckpointTo(daemon.containersReplica); err != nil {
log.G(context.TODO()).WithFields(log.Fields{
"error": err,
"container": container.ID,
}).Warn("error checkpointing container state")
}
}
// if the container is currently restarting we do not need to send the signal