daemon: kill: use log level to "warn" if container doesn't exit in time

I noticed this log being logged as an error, but the kill logic actually
proceeds after this (doing a "direct" kill instead). While usually containers
are expected to be exiting within the given timeout, I don't think this
needs to be logged as an error (an error is returned after we fail to
kill the container).

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
This commit is contained in:
Sebastiaan van Stijn 2023-11-29 15:43:08 +01:00
parent 5dde37c846
commit 61d8f57f2a
No known key found for this signature in database
GPG key ID: 76698F39D527CE8C

View file

@ -171,7 +171,7 @@ func (daemon *Daemon) Kill(container *containerpkg.Container) error {
return nil
}
log.G(ctx).WithError(status.Err()).WithField("container", container.ID).Errorf("Container failed to exit within %v of kill - trying direct SIGKILL", waitTimeout)
log.G(ctx).WithFields(log.Fields{"error": status.Err(), "container": container.ID}).Warnf("Container failed to exit within %v of kill - trying direct SIGKILL", waitTimeout)
if err := killProcessDirectly(container); err != nil {
if errors.As(err, &errNoSuchProcess{}) {