Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Docker stop does not send control signal for Windows containers with TTY #40678

Open
StephenCleary opened this issue Mar 12, 2020 · 0 comments
Open

Comments

@StephenCleary
Copy link

(migrated from docker/for-win#5996)

Description

docker stop correctly sends Windows containers CTRL_SHUTDOWN_EVENT if there is no TTY (-t option). If docker stop is used on a container run with -t, then no console control event is sent to the container.

Steps to reproduce the issue:

  1. Build a console app that listens for console control signals.
  2. Run the app in a Windows docker container, passing the -t flag.
  3. Stop that docker container.

Repro available here

Describe the results you received:

When stopping the container with docker stop, the application does not receive CTRL_SHUTDOWN_EVENT. Instead, it's killed after the 10-second timeout.

Describe the results you expected:

Application receives CTRL_SHUTDOWN_EVENT.

Additional information you deem important (e.g. issue happens only occasionally):

Linux containers do not have this problem; they can shutdown cleanly regardless of whether they were run with -t.

Windows containers only have this problem if the -t command line parameter is used to run them. If they are run without -t, then they get the CTRL_SHUTDOWN_EVENT just fine.

Output of docker version:

Client: Docker Engine - Community
 Version:           19.03.5
 API version:       1.40
 Go version:        go1.12.12
 Git commit:        633a0ea
 Built:             Wed Nov 13 07:22:37 2019
 OS/Arch:           windows/amd64
 Experimental:      false

Server: Docker Engine - Community
 Engine:
  Version:          19.03.5
  API version:      1.40 (minimum version 1.24)
  Go version:       go1.12.12
  Git commit:       633a0ea
  Built:            Wed Nov 13 07:36:50 2019
  OS/Arch:          windows/amd64
  Experimental:     false

Output of docker info:

Client:
 Debug Mode: false

Server:
 Containers: 0
  Running: 0
  Paused: 0
  Stopped: 0
 Images: 15
 Server Version: 19.03.5
 Storage Driver: windowsfilter
  Windows:
 Logging Driver: json-file
 Plugins:
  Volume: local
  Network: ics internal l2bridge l2tunnel nat null overlay private transparent
  Log: awslogs etwlogs fluentd gcplogs gelf json-file local logentries splunk syslog
 Swarm: inactive
 Default Isolation: hyperv
 Kernel Version: 10.0 18362 (18362.1.amd64fre.19h1_release.190318-1202)
 Operating System: Windows 10 Pro Version 1903 (OS Build 18362.719)
 OSType: windows
 Architecture: x86_64
 CPUs: 8
 Total Memory: 31.78GiB
 Name: STEPHEN2019
 ID: AVLQ:GXDD:ABMM:E62O:HDMV:EKVV:J5LL:PAT7:R6MG:WORN:VQUO:DI4I
 Docker Root Dir: C:\ProgramData\Docker
 Debug Mode: true
  File Descriptors: -1
  Goroutines: 28
  System Time: 2020-03-12T07:11:37.7863948-04:00
  EventsListeners: 1
 Registry: https://index.docker.io/v1/
 Labels:
 Experimental: false
 Insecure Registries:
  127.0.0.0/8
 Live Restore Enabled: false
 Product License: Community Engine

Additional environment details (AWS, VirtualBox, physical, etc.):

Physical box, Windows 10.0.18362 Build 18362

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants