Conversation
|
how would this happen? conmon is setting |
|
It seems subreaper handles the normal case where process re-parenting works as expected. The problem is that in some systemd configurations, even with subreaper set container processes may not become direct children of conmon. |
how would that happen? conmon runs the OCI runtime that in turns runs the container. Every container process is a descendant of conmon |
|
does it break when there are |
|
Good catch! Let me add some bits to handle this. |
|
@giuseppe Is it better now? Or is there anything else I missed? |
|
I am not really a fan of the probe part, can we understand how that configuration happens? Because conmon should get the signal, even with exec sessions (the container exits, all the processes in the pid namespace are killed and their parent gets the sigchld) |
|
Normally this would be the expected state: But what happens in the case described in the issue is: So systemd moves the container process to the new scope after OCI runtime creates it but before OCI runtime exits. This seems to be why conmon receives the runtime exit signal (from runtime) but misses the container exit signal. Does it make it any more clear? |
|
how does the cgroup affect the parent->child relationship? I don't think it should matter in what cgroup the process ends up, it should still be reported to the conmon (assuming set_reaper() was used correctly) used for the exec session. You can verify it by running and PPid is the conmon process. |
When container processes are not direct children of conmon conmon fails to detect container exits because it never receives SIGCHLD signals. This fixes issue where conmon processes remain running after container exit in certain systemd cgroup manager configurations. Fixes: #545 Signed-off-by: Jindrich Novy <jnovy@redhat.com>
|
Ok, let's keep the fix minimal - I removed the probe and left only the main part. @giuseppe PTAL |
giuseppe
left a comment
There was a problem hiding this comment.
I am ok with this extra check but I still don't understand how we could end up in this situation, unless the OCI runtime is misbehaving. Could we adjust the comment that mentions the process not being a child of conmon?
LGTM
|
Comment adjusted, thanks! |
When container processes are not direct children of conmon conmon fails to detect container exits because it never receives SIGCHLD signals.
This fixes issue where conmon processes remain running after container exit in certain systemd cgroup manager configurations.
Fixes: #545