cri-o/oci
Alexander Larsson af4fbcd942 conmon: Don't leave zombies and fix cgroup race
Currently, when creating containers we never call Wait on the
conmon exec.Command, which means that the child hangs around
forever as a zombie after it dies.

However, instead of doing this waitpid() in the parent we instead
do a double-fork in conmon, to daemonize it. That makes a lot of
sense, as conmon really is not tied to the launcher, but needs
to outlive it if e.g. the cri-o daemon restarts.

However, this makes even more obvious a race condition which we
already have. When crio-d puts the conmon pid in a cgroup there
is a race where conmon could already have spawned a child, and
it would then not be part of the cgroup. In order to fix this
we add another synchronization pipe to conmon, which we block
on before we create any children. The parent then makes sure the
pid is in the cgroup before letting it continue.

Signed-off-by: Alexander Larsson <alexl@redhat.com>
2017-06-15 14:20:40 +02:00
..
container.go Implement non-terminal attach 2017-06-14 22:59:50 +02:00
history.go use an in memory store for containers 2016-09-19 13:11:36 +02:00
memory_store.go oci: more grep'able interface name 2017-04-19 16:12:59 -04:00
oci.go conmon: Don't leave zombies and fix cgroup race 2017-06-15 14:20:40 +02:00
store.go oci: more grep'able interface name 2017-04-19 16:12:59 -04:00