Skip to content

Commit

Permalink
Fix log statement 'failed to exit' timeout accuracy
Browse files Browse the repository at this point in the history
log statement should reflect how long it actually waited, not how long
it theoretically could wait based on the 'seconds' integer passed in.

Signed-off-by: Cam <gh@sparr.email>
(cherry picked from commit d15ce13)
Signed-off-by: Brian Goff <cpuguy83@gmail.com>
  • Loading branch information
sparrc authored and cpuguy83 committed Oct 20, 2021
1 parent a4bcd4c commit 3285c27
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion daemon/stop.go
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,7 @@ func (daemon *Daemon) containerStop(container *containerpkg.Container, seconds i
return err
}

logrus.WithField("container", container.ID).Infof("Container failed to exit within %d seconds of signal %d - using the force", seconds, stopSignal)
logrus.WithField("container", container.ID).Infof("Container failed to exit within %s of signal %d - using the force", wait, stopSignal)
// Stop either failed or container didnt exit, so fallback to kill.
if err := daemon.Kill(container); err != nil {
// got a kill error, but give container 2 more seconds to exit just in case
Expand Down

0 comments on commit 3285c27

Please sign in to comment.