A step's sandbox has no limit on CPU or memory #496

Open
opened 2026-11-11 17:44:38 -05:00 by cmoriarty · 0 comments
Owner

What happens
Step sandboxes (braid#203) separate files, processes and ports, and share the container's CPU and memory. One step's runaway test or build can starve the others and osfd. The container has no cgroup delegation, so bubblewrap cannot set limits.

Fix (to design)
Delegate a cgroup subtree to the container (a private cgroup namespace with a writable /sys/fs/cgroup), and have the manager put each sandbox in a cgroup of its own with memory.high, memory.max and cpu.max. Ending a sandbox can then use cgroup.kill.

Done when
A step that allocates past its limit is stopped with a message that says so, and another step running beside it is unaffected.

**What happens** Step sandboxes (braid#203) separate files, processes and ports, and share the container's CPU and memory. One step's runaway test or build can starve the others and osfd. The container has no cgroup delegation, so bubblewrap cannot set limits. **Fix (to design)** Delegate a cgroup subtree to the container (a private cgroup namespace with a writable `/sys/fs/cgroup`), and have the manager put each sandbox in a cgroup of its own with `memory.high`, `memory.max` and `cpu.max`. Ending a sandbox can then use `cgroup.kill`. **Done when** A step that allocates past its limit is stopped with a message that says so, and another step running beside it is unaffected.
Sign in to join this conversation.
No labels
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set

Reference
cmoriarty/braid#496
No description provided.