Public: anyone can read this; the crew can change it.

A runner's cgroup delegated after it starts is used: a named cgroup not yet writable is asked again #17501

opened this

Merged 13h 33m ago, live in production

cgroupHost() decided once per process. A runner whose cgroup the host binds in a moment after the container starts (runners.sh, as root: Docker mounts cgroupfs read-only and root's, though each container's scope is delegated) would have kept its first "uncontained" for life if its first job came first.

Notes

opened this

cgroupHost() decided once per process. A runner whose cgroup the host binds in a moment after the container starts (runners.sh, as root: Docker mounts cgroupfs read-only and root's, though each container's scope is delegated) would have kept its first "uncontained" for life if its first job came first. Now an answer is kept only when no later moment can change it (settled): a cgroup in use, or a refusal (off, no cgroup v2, not at a namespace root unnamed); a cgroup named by FORGE_CELL_CGROUP but not yet writable is asked again by the next cell. Proved in colima (my own profile) in a container flagged like forge-runner-1 (cgroupns private, uid 1000, cap-drop ALL, no-new-privileges), its scope bound in 3 s after start: the same process found it, and each cell got cpu.max (held at 1.00 core, throttled), memory.max (OOM-killed whole at exactly 256 MiB) and pids.max (stopped at 512); test/cgroup.test.ts passes 23/23 there, delegated, its kernel tests included. A closed cell's cgroup is gone within about 200 ms (cgroup.kill, then rmdir once reaped): a new Linux-only test holds it, skipped where nothing is delegated.

Direction: contributors' cells on runners held by the kernel, as the owner chose (a) on 12-02 (#10441) No door: runner internals; what a cell is held by shows on /system and in the check's log as before

🤖 Generated with Claude Code

commented

The contain.test.ts changes aren't unrelated; the skip rule required them once this pull touched the file. The check said: "5 of 32 tests skipped, not run: this pull's own test must run, and a skipped test is not a pass; make it run, or declare its condition with test.skipIf" (src/checks/own_skips.ts). The rule reads each skipped test's own line and the lines of its enclosing describe blocks, as bun's JUnit report names them, and accepts only .skipIf( or .if( there. So const bySocket = … ? describe.skip : describe was read as undeclared, which is why it's now describe.skipIf(noSockets). And bun reports a multi-line describe.skipIf(noCells)( at its title's line, not the call's, which is why each title now sits on the describe line. Applying the rule to a real run of the file gave 11 undeclared skips before and none after. Dropped as you asked: the spinning-cell removal test and the cgroup.kill docs sentence.

🤖 Generated with Claude Code

Sign in to join this conversation.

Search
↑↓ navigate ↵ open ⌘↵ its app esc close

Keyboard shortcuts

Docs