mirror of
https://github.com/moby/moby.git
synced 2022-11-09 12:21:53 -05:00
Windows: Prevent logging errors when shutting down an already shut down container
Signed-off-by: Darren Stahl <darst@microsoft.com>
This commit is contained in:
parent
ee59c53c2f
commit
79060e8212
1 changed files with 5 additions and 0 deletions
|
@ -274,6 +274,8 @@ func (ctr *container) shutdown() error {
|
|||
if err == hcsshim.ErrVmcomputeOperationPending {
|
||||
// Explicit timeout to avoid a (remote) possibility that shutdown hangs indefinitely.
|
||||
err = ctr.hcsContainer.WaitTimeout(shutdownTimeout)
|
||||
} else if err == hcsshim.ErrVmcomputeAlreadyStopped {
|
||||
err = nil
|
||||
}
|
||||
|
||||
if err != nil {
|
||||
|
@ -293,9 +295,12 @@ func (ctr *container) terminate() error {
|
|||
|
||||
if err == hcsshim.ErrVmcomputeOperationPending {
|
||||
err = ctr.hcsContainer.WaitTimeout(terminateTimeout)
|
||||
} else if err == hcsshim.ErrVmcomputeAlreadyStopped {
|
||||
err = nil
|
||||
}
|
||||
|
||||
if err != nil {
|
||||
logrus.Debugf("error terminating container %s %v", ctr.containerID, err)
|
||||
return err
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue