mirror of
https://github.com/Niko1221/Strata.git
synced 2026-12-06 16:29:04 +00:00
The container CPU quota that caps the default worker count was read from the root of the cgroup mount only. That is the process's own group when the container has its own cgroup namespace, but not for a systemd service or scope, an older runtime, or a limit set on a parent group: there the mount shows the host's tree and the limit sits in the group or above it. container_cpu_quota() now reads /proc/self/cgroup and takes the smallest quota from the process's group up to the root, for cgroup v2 (cpu.max) and v1 (cpu.cfs_quota_us / cpu.cfs_period_us), as the memory guard already does. A mount that is the container's own group reads as before. cgroup_cpu_test runs it against a fake cgroup tree: own namespace, a limit on a parent, a tighter and a looser group limit, a missing path, v1, and a hybrid system.