-
Notifications
You must be signed in to change notification settings - Fork 2k
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
Do not disable sig-proxy when using a TTY #1841
Conversation
@vdemeester I tried coming up with an e2e test for this, but I couldn't get it to work (creating a container with a TTY attached, then signal that docker cli); perhaps you have ideas?) |
Codecov Report
@@ Coverage Diff @@
## master #1841 +/- ##
==========================================
+ Coverage 56.73% 56.74% +<.01%
==========================================
Files 310 310
Lines 21803 21801 -2
==========================================
Hits 12370 12370
+ Misses 8518 8517 -1
+ Partials 915 914 -1 |
oooh, actually, I think I might've found it 🤗 - cleaning up a bit, and will add a test |
d5067c6
to
25687c7
Compare
Dang; why doesn't it work here 😞
|
Hm... it works when running |
c07700f
to
c8d8f55
Compare
Ok, so my test passes with
|
e9044ef
to
0c2295b
Compare
If someone has any ideas on the test, help is appreciated 🤗 |
This partially reverts moby/moby@e0b59ab, and does not automatically disable proxying signals in TTY-mode Before this change: ------------------------------------ Start a container with a TTY in one shell: ``` docker run -it --init --name repro-28872 busybox sleep 30 ``` then, in another shell, kill the docker cli: ``` kill `pgrep -f repro-28872` ``` Notice that the CLI was killed, but the signal not forwarded to the container; the container continues running ``` docker container inspect --format '{{ .State.Status }}' repro-28872 running docker container rm -f repro-28872 ``` After this change: ------------------------------------ Start a container with a TTY in one shell: ``` docker run -it --init --name repro-28872 busybox sleep 30 ``` then, in another shell, kill the docker cli: ``` kill `pgrep -f repro-28872` ``` Verify that the signal was forwarded to the container, and the container exited ``` docker container inspect --format '{{ .State.Status }}' repro-28872 exited docker container rm -f repro-28872 ``` Signed-off-by: Sebastiaan van Stijn <[email protected]>
Add a test to verify that killing the docker CLI forwards the signal to the container. Test-case for moby/moby 28872 Signed-off-by: Sebastiaan van Stijn <[email protected]>
I'll be damned.. LOL, tests are green now 🤷♂ let me remove the testing commits from here |
Well.. there you go; all green and shiny 🎉 ping @vdemeester @tianon @silvin-lubecki PTAL |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM 👍
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM 🐯
Speedy gonzales ! |
Similar to docker#1841 Signed-off-by: Sebastiaan van Stijn <[email protected]>
Similar to docker#1841 Signed-off-by: Sebastiaan van Stijn <[email protected]>
This partially reverts moby/moby@e0b59ab (moby/moby#2426), and does not automatically disable proxying signals in TTY-mode
fixes moby/moby#28872 (docker client doesn't pass signals when a terminal is attached)
fixes moby/moby#3793 docker client not passing signals to dockerd
relates to:
docker exec
command will not terminate the spawned process moby/moby#9098 Killdocker exec
command will not terminate the spawned processdocker exec
case; it looks like there's no API to kill an exec'd process, so there's no signal-proxy for this yetBefore this change:
Start a container with a TTY in one shell:
then, in another shell, kill the docker cli:
Notice that the CLI was killed, but the signal not forwarded to the container;
the container continues running
After this change:
Start a container with a TTY in one shell:
then, in another shell, kill the docker cli:
Verify that the signal was forwarded to the container, and the container exited
- Description for the changelog
- A picture of a cute animal (not mandatory but encouraged)