mirror of
https://github.com/containers/youki
synced 2026-11-30 13:36:23 +01:00
* feat(libcgroups): set OOMPolicy from unified memory.oom.group With the systemd cgroup driver, unified memory.oom.group was written to the cgroup but the unit kept OOMPolicy=continue, so the next time systemd applied the unit's cgroup settings it reset the file to 0. systemd takes OOMPolicy only when the unit is created. Add with_initial_resources() to AnyCgroupManager; the intermediate process passes the container's resources, and the systemd manager sends OOMPolicy (0 continue, 1 kill, systemd >= 253) with the request that starts the transient unit, as runc does. The contest test for a key without a property now uses cgroup.max.depth, since systemd writes memory.oom.group itself. Signed-off-by: Asifur Rahaman Meeru <asifur.rahaman@meeru.dev> * refactor(libcgroups): move oom_policy below apply Signed-off-by: Asifur Rahaman Meeru <asifur.rahaman@meeru.dev> * fix(libcgroups): reset a failed systemd unit when removing it With OOMPolicy=kill systemd marks the scope as failed once the OOM killer has killed its processes, and stopping the unit leaves it loaded. A new container with the same cgroupsPath then fails with "Unit is not active, refusing." Call ResetFailedUnit after StopUnit, as runc does. Signed-off-by: Asifur Rahaman Meeru <asifur.rahaman@meeru.dev> --------- Signed-off-by: Asifur Rahaman Meeru <asifur.rahaman@meeru.dev>