Bug 1087704 - repetition of signal 21 with --sig-proxy and SIGSTOP of docker
Summary: repetition of signal 21 with --sig-proxy and SIGSTOP of docker
Keywords:
Status: CLOSED CANTFIX
Alias: None
Product: Fedora
Classification: Fedora
Component: docker-io
Version: 20
Hardware: Unspecified
OS: Unspecified
unspecified
low
Target Milestone: ---
Assignee: Matthew Heon
QA Contact: Fedora Extras Quality Assurance
URL:
Whiteboard:
Depends On:
Blocks: 1096273
TreeView+ depends on / blocked
 
Reported: 2014-04-15 06:17 UTC by Lukas Doktor
Modified: 2015-04-15 12:17 UTC (History)
10 users (show)

Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Clone Of:
: 1096273 (view as bug list)
Environment:
Last Closed: 2015-04-15 12:17:16 UTC
Type: Bug


Attachments (Terms of Use)

Description Lukas Doktor 2014-04-15 06:17:24 UTC
Description of problem:
I noticed weird reaction to SIGSTOP signal. When you start container with --sig-proxy, ignore all signals in container and from OS use kill -SIGSTOP to the `docker run` process, it's put into background. (so far correct behavior) Than when you use kill -SIGCONT, it's resumed (still in background) and it's continuing to send signal 21 to the container (100% CPU utilization).
This disappears once you attach the process with fg.

Version-Release number of selected component (if applicable):
docker-io-0.9.1-1.fc21.x86_64


How reproducible:
always

Steps to Reproduce:
1. /usr/bin/docker -D run --tty=false --rm -i --name test_eoly localhost:5000/ldoktor/fedora:latest bash -c 'for NUM in `seq 1 64`; do trap "echo Received $NUM, ignoring..." $NUM; done; while :; do sleep 1; done'
2. ps ax |grep docker
3. kill -SIGSTOP $PID
4. kill -SIGCONT $PID

Actual results:
[1]+  Pozastavena             /usr/bin/docker -D run --tty=false --rm -i --name test_eoly localhost:5000/ldoktor/fedora:latest bash -c 'for NUM in `seq 1 64`; do trap "echo Received $NUM, ignoring..." $NUM; done; while :; do sleep 1; done'
[root@t530 ~]# Received 21, ignoring...
Received 21, ignoring...
Received 21, ignoring...
Received 21, ignoring...
Received 21, ignoring...
Received 21, ignoring...
... (100% CPU utilization, when you use fg it stops and you can use the container again...)

Expected results:
[1]+  Pozastavena             /usr/bin/docker -D run --tty=false --rm -i --name test_eoly localhost:5000/ldoktor/fedora:latest bash -c 'for NUM in `seq 1 64`; do trap "echo Received $NUM, ignoring..." $NUM; done; while :; do sleep 1; done'
[root@t530 ~]# Received 21, ignoring...

Additional info:
I'm not definitely sure if this is really required as it's not a common usage. But as there is no way to detach the process apart from kill -SIGSTOP people might use it and get to this problem...

Comment 1 Lukas Doktor 2014-05-05 07:59:30 UTC
I retested this with the upstream dc9c28f/0.10.0 with the same results. The daemon output is:
...
[/home/medic/Work/Projekty/Docker/root|fa3816b6] -job kill(b01a849cb45ebe94c3a61fa021a5464186345d5b159faee4ea9d5da39fb36de5, TTIN) = OK (0)
2014/05/05 09:58:13 POST /v1.10/containers/b01a849cb45ebe94c3a61fa021a5464186345d5b159faee4ea9d5da39fb36de5/kill?signal=TTIN
[/home/medic/Work/Projekty/Docker/root|fa3816b6] +job kill(b01a849cb45ebe94c3a61fa021a5464186345d5b159faee4ea9d5da39fb36de5, TTIN)
[/home/medic/Work/Projekty/Docker/root|fa3816b6] -job kill(b01a849cb45ebe94c3a61fa021a5464186345d5b159faee4ea9d5da39fb36de5, TTIN) = OK (0)
2014/05/05 09:58:13 POST /v1.10/containers/b01a849cb45ebe94c3a61fa021a5464186345d5b159faee4ea9d5da39fb36de5/kill?signal=TTIN
[/home/medic/Work/Projekty/Docker/root|fa3816b6] +job kill(b01a849cb45ebe94c3a61fa021a5464186345d5b159faee4ea9d5da39fb36de5, TTIN)
[/home/medic/Work/Projekty/Docker/root|fa3816b6] -job kill(b01a849cb45ebe94c3a61fa021a5464186345d5b159faee4ea9d5da39fb36de5, TTIN) = OK (0)
2014/05/05 09:58:13 POST /v1.10/containers/b01a849cb45ebe94c3a61fa021a5464186345d5b159faee4ea9d5da39fb36de5/kill?signal=TTIN
[/home/medic/Work/Projekty/Docker/root|fa3816b6] +job kill(b01a849cb45ebe94c3a61fa021a5464186345d5b159faee4ea9d5da39fb36de5, TTIN)
...

Comment 2 Daniel Walsh 2014-05-19 21:29:51 UTC
Are you still seeing this with 0.11?

Comment 3 Lukas Doktor 2014-05-20 11:30:38 UTC
I tested it only on RHEL version of this package here: https://bugzilla.redhat.com/show_bug.cgi?id=1096273

the bug persists...

Comment 4 Daniel Walsh 2014-09-15 19:59:52 UTC
Can you test against docker-1.2

Comment 5 Lukas Doktor 2014-09-29 08:44:42 UTC
On docker-1.2.0-19.el7.x86_64 it still fails and results in too many open files:

[debug] commands.go:610 Error sending signal: Post http:///var/run/docker.sock/v1.15/containers/64b2b2d8171bca438d6c7a0e2ed93573e0dd37ab1a0c9a2f75f8acd77bda8236/kill?signal=TTIN: dial unix /var/run/docker.sock: too many open files
[debug] commands.go:610 Error sending signal: Post http:///var/run/docker.sock/v1.15/containers/64b2b2d8171bca438d6c7a0e2ed93573e0dd37ab1a0c9a2f75f8acd77bda8236/kill?signal=TTIN: dial unix /var/run/docker.sock: too many open files
[debug] commands.go:610 Error sending signal: Post http:///var/run/docker.sock/v1.15/containers/64b2b2d8171bca438d6c7a0e2ed93573e0dd37ab1a0c9a2f75f8acd77bda8236/kill?signal=TTIN: dial unix /var/run/docker.sock: too many open files
[debug] commands.go:610 Error sending signal: Post http:///var/run/docker.sock/v1.15/containers/64b2b2d8171bca438d6c7a0e2ed93573e0dd37ab1a0c9a2f75f8acd77bda8236/kill?signal=TTIN: dial unix /var/run/docker.sock: too many open files
[debug] commands.go:610 Error sending signal: Post http:///var/run/docker.sock/v1.15/containers/64b2b2d8171bca438d6c7a0e2ed93573e0dd37ab1a0c9a2f75f8acd77bda8236/kill?signal=TTIN: dial unix /var/run/docker.sock: too many open files
[debug] stdcopy.go:98 Corrupted prefix: []
[debug] hijack.go:102 [hijack] End of stdout
[debug] hijack.go:110 [hijack] End of stdin
[debug] hijack.go:118 Couldn't send EOF: use of closed network connection
[debug] commands.go:2332 End of CmdRun(), Waiting for hijack to finish.
2014/09/26 13:07:49 Get http:///var/run/docker.sock/v1.15/containers/64b2b2d8171bca438d6c7a0e2ed93573e0dd37ab1a0c9a2f75f8acd77bda8236/json: dial unix /var/run/docker.sock: too many open files

Comment 7 Matthew Heon 2015-01-22 16:26:19 UTC
I'm fairly certain this is an issue with Golang, not docker-specific. Upstream issue tracker describing very similar symptoms from SIGSTOP: 
https://github.com/golang/go/issues/4391

Comment 8 Daniel Walsh 2015-04-15 12:17:16 UTC
Not something docker can fix.


Note You need to log in before you can comment on or make changes to this bug.