|
|
|
|
|
by thwarted
3757 days ago
|
|
Poettering says that PID 1 has special requirements. One of these is killing "zombie" processes that have been abandoned by their calling session. This is a real problem for Docker since the application runs as PID 1 and does not handle the zombie processes. For example, containers running the Oracle database can end up with thousands of zombie processes. Why does Poettering keep claiming this when he's the one who submitted the patch that adds the PR_SET_CHILD_SUBREAPER prctl(2) [0] functionality? [0] http://man7.org/linux/man-pages/man2/prctl.2.html |
|
PR_SET_CHILD_SUBREAPER moves the ownership of an orphaned process to whichever process was selected rather than the default PID1, and that only works for descendant of the subreaper.
The problem pointed by the quote is that normal software doesn't go around checking if it has zombie children and waiting on them, so in a container with random software S set as PID1 and creating subprocesses, zombies may accumulate until resources are exhausted[0].
PR_SET_CHILD_SUBREAPER is a way to cause that problem on a system with a proper init (or to test that your init works properly without needing to boot into it)
It's not a new observation: https://blog.phusion.nl/2015/01/20/docker-and-the-pid-1-zomb...
Previous HN discussion: https://news.ycombinator.com/item?id=8916785
[0] by default the limit is 32k processes after which the kernel will simply refuse to create new ones