Shutdown instead of terminate process on Windows

Signed-off-by: Darren Stahl <darst@microsoft.com>
Upstream-commit: 8b503242734d66a223bf8d694f26901b1d02106d
Component: engine
This commit is contained in:
Darren Stahl
2016-11-18 12:05:08 -08:00
parent b58d62c699
commit bee0ae1311
@@ -15,7 +15,7 @@ import (
"github.com/Microsoft/hcsshim"
"github.com/Sirupsen/logrus"
"github.com/docker/docker/pkg/sysinfo"
"github.com/opencontainers/runtime-spec/specs-go"
specs "github.com/opencontainers/runtime-spec/specs-go"
)
type client struct {
@@ -396,10 +396,12 @@ func (clnt *client) Signal(containerID string, sig int) error {
}
}
} else {
// Terminate Process
if err := cont.hcsProcess.Kill(); err != nil && !hcsshim.IsAlreadyStopped(err) {
// ignore errors
logrus.Warnf("libcontainerd: failed to terminate pid %d in %s: %q", cont.systemPid, containerID, err)
// Shut down the container
if err := cont.hcsContainer.Shutdown(); err != nil {
if !hcsshim.IsPending(err) && !hcsshim.IsAlreadyStopped(err) {
// ignore errors
logrus.Warnf("libcontainerd: failed to shutdown container %s: %q", containerID, err)
}
}
}