Merge pull request #35184 from darrenstahlmsft/shutdownTimeout
Increase container default shutdown timeout on Windows Upstream-commit: 7848b8beb9d38a98a78b75f78e05f8d2255f9dfe Component: engine
This commit is contained in:
@@ -52,11 +52,6 @@ import (
|
||||
|
||||
const configFileName = "config.v2.json"
|
||||
|
||||
const (
|
||||
// DefaultStopTimeout is the timeout (in seconds) for the syscall signal used to stop a container.
|
||||
DefaultStopTimeout = 10
|
||||
)
|
||||
|
||||
var (
|
||||
errInvalidEndpoint = errors.New("invalid endpoint while building port map info")
|
||||
errInvalidNetwork = errors.New("invalid network settings while building port map info")
|
||||
|
||||
@@ -21,6 +21,9 @@ import (
|
||||
)
|
||||
|
||||
const (
|
||||
// DefaultStopTimeout is the timeout (in seconds) for the syscall signal used to stop a container.
|
||||
DefaultStopTimeout = 10
|
||||
|
||||
containerSecretMountPath = "/run/secrets"
|
||||
)
|
||||
|
||||
|
||||
@@ -16,6 +16,9 @@ const (
|
||||
containerSecretMountPath = `C:\ProgramData\Docker\secrets`
|
||||
containerInternalSecretMountPath = `C:\ProgramData\Docker\internal\secrets`
|
||||
containerInternalConfigsDirPath = `C:\ProgramData\Docker\internal\configs`
|
||||
|
||||
// DefaultStopTimeout is the timeout (in seconds) for the shutdown call on a container
|
||||
DefaultStopTimeout = 30
|
||||
)
|
||||
|
||||
// UnmountIpcMount unmounts Ipc related mounts.
|
||||
|
||||
@@ -993,7 +993,8 @@ func (daemon *Daemon) Shutdown() error {
|
||||
}
|
||||
|
||||
if daemon.containers != nil {
|
||||
logrus.Debugf("start clean shutdown of all containers with a %d seconds timeout...", daemon.configStore.ShutdownTimeout)
|
||||
logrus.Debugf("daemon configured with a %d seconds minimum shutdown timeout", daemon.configStore.ShutdownTimeout)
|
||||
logrus.Debugf("start clean shutdown of all containers with a %d seconds timeout...", daemon.ShutdownTimeout())
|
||||
daemon.containers.ApplyAll(func(c *container.Container) {
|
||||
if !c.IsRunning() {
|
||||
return
|
||||
|
||||
@@ -2789,7 +2789,7 @@ func (s *DockerDaemonSuite) TestDaemonShutdownTimeout(c *check.C) {
|
||||
case <-time.After(5 * time.Second):
|
||||
}
|
||||
|
||||
expectedMessage := `level=debug msg="start clean shutdown of all containers with a 3 seconds timeout..."`
|
||||
expectedMessage := `level=debug msg="daemon configured with a 3 seconds minimum shutdown timeout"`
|
||||
content, err := s.d.ReadLogFile()
|
||||
c.Assert(err, checker.IsNil)
|
||||
c.Assert(string(content), checker.Contains, expectedMessage)
|
||||
|
||||
Reference in New Issue
Block a user