open-nomad/drivers/exec
Seth Hoenig 96ec19788d cgroups: make sure cgroup still exists after task restart
This PR modifies raw_exec and exec to ensure the cgroup for a task
they are driving still exists during a task restart. These drivers
have the same bug but with different root cause.

For raw_exec, we were removing the cgroup in 2 places - the cpuset
manager, and in the unix containment implementation (the thing that
uses freezer cgroup to clean house). During a task restart, the
containment would remove the cgroup, and when the task runner hooks
went to start again would block on waiting for the cgroup to exist,
which will never happen, because it gets created by the cpuset manager
which only runs as an alloc pre-start hook. The fix here is to simply
not delete the cgroup in the containment implementation; killing the
PIDs is enough. The removal happens in the cpuset manager later anyway.

For exec, it's the same idea, except DestroyTask is called on task
failure, which in turn calls into libcontainer, which in turn deletes
the cgroup. In this case we do not have control over the deletion of
the cgroup, so instead we hack the cgroup back into life after the
call to DestroyTask.

All of this only applies to cgroups v2.
2022-05-05 09:51:03 -05:00
..
driver.go cgroups: make sure cgroup still exists after task restart 2022-05-05 09:51:03 -05:00
driver_test.go exec: fix exec handler test 2022-04-06 12:11:37 -05:00
driver_unix_test.go client: enable support for cgroups v2 2022-03-23 11:35:27 -05:00
handle.go executor: remove structs package 2018-12-06 20:54:14 -05:00
state.go Update exec driver to match rawexec 2018-11-08 10:00:49 -08:00