open-nomad/client/lib/cgutil
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
..
cgutil_linux.go raw_exec: make raw exec driver work with cgroups v2 2022-04-04 16:11:38 -05:00
cgutil_linux_test.go client: cgroups v2 code review followup 2022-03-24 13:40:42 -05:00
cgutil_noop.go client: enable support for cgroups v2 2022-03-23 11:35:27 -05:00
cpuset_manager.go client: enable support for cgroups v2 2022-03-23 11:35:27 -05:00
cpuset_manager_test.go client: enable support for cgroups v2 2022-03-23 11:35:27 -05:00
cpuset_manager_v1.go client: cgroups v2 code review followup 2022-03-24 13:40:42 -05:00
cpuset_manager_v1_test.go client: cgroups v2 code review followup 2022-03-24 13:40:42 -05:00
cpuset_manager_v2.go client: cgroups v2 code review followup 2022-03-24 13:40:42 -05:00
cpuset_manager_v2_test.go client: cgroups v2 code review followup 2022-03-24 13:40:42 -05:00
group_killer.go cgroups: make sure cgroup still exists after task restart 2022-05-05 09:51:03 -05:00