Commit ead324c
authored
[Docker] Fix ssh zombie processes issue (#3295)
SSHTunnel.open() starts the ssh process with -f option, which
causes it to become a daemon (it calls daemon(3) after authentication).
Then, SSHTunnel.close() uses `ssh -O exit` to ask that daemon process
to exit (the processes communicate via the control socket, -S option).
The daemon exits, and then PID 1 should reap it.
Before #3165, PID 1 was bash,
which handles SIGCHLD, properly wait(2)ing children, but in that
pull request exec was added, making `dstack server` PID 1. dstack
does nothing with SIGCHLD (neither handles nor explicitly ignores
it), thus the default disposition (ignore the signal but do not discard
children) leads to an evergrowing number of unreaped zombies.
Fixes: #32911 parent 14db582 commit ead324c
1 file changed
+2
-2
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
10 | 10 | | |
11 | 11 | | |
12 | 12 | | |
13 | | - | |
| 13 | + | |
14 | 14 | | |
15 | 15 | | |
16 | 16 | | |
| |||
23 | 23 | | |
24 | 24 | | |
25 | 25 | | |
26 | | - | |
| 26 | + | |
27 | 27 | | |
0 commit comments