From 79060e821228b9e86bbd9e9212756a61b0901c11 Mon Sep 17 00:00:00 2001 From: Darren Stahl Date: Mon, 20 Jun 2016 16:57:08 -0700 Subject: [PATCH] Windows: Prevent logging errors when shutting down an already shut down container Signed-off-by: Darren Stahl --- libcontainerd/container_windows.go | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/libcontainerd/container_windows.go b/libcontainerd/container_windows.go index 7e36e857ec..49c2725774 100644 --- a/libcontainerd/container_windows.go +++ b/libcontainerd/container_windows.go @@ -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 }