Repository navigation
feat(core): bound Linux command process trees with cgroup v2 - #405
Conversation
Codex Review SummaryThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
|
Codex usage limits have been reached for code reviews. Please check with the admins of this repo to increase the limits by adding credits. |
|
@codex review |
|
Codex Review: Didn't find any major issues. Chef's kiss. Reviewed commit: ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
If Codex has suggestions, it will comment; otherwise it will react with 👍. Codex can also answer questions or update the PR. Try commenting "@codex address that feedback". |
Scoped Linux commands can now receive aggregate memory, native-task and CPU-bandwidth limits through portable
NativeResourceLimits. The trusted helper joins a configured cgroup before starting the payload; scripts and descendants inherit the limits. Swap is disabled, OOM kills the group, real-time scheduling is refused, and completed or cancelled commands remove their group. Empty groups left by dead owners are reclaimed without touching live owners or another PID namespace.Limits are mandatory in the persisted request identity: omission is rejected and a retry cannot widen authority. Linux requires an explicitly delegated, identity-checked cgroup root and a private filesystem root without writable cgroup controls. Unsupported launchers/platforms refuse the request. No new dependency or per-command service/VM.
Verified: 65 focused core tests and 38 worker/process tests; explicit native delegation fixture passes thread exhaustion, kernel-recorded memory OOM, CPU controller values, cancellation, stale-group reclamation and cleanup. Disabling cgroup attachment makes that fixture fail. Formatting, lint and Clippy pass. The existing sleep allowlist only moves two line numbers; no sleeps added. Full platform checks run in CI per the requested workflow.
Native fixture: run
cargo nextest run -p qq --test command_worker_client --run-ignored only -E 'test(resources::delegated_resource_scope)'inside a disposable service withDelegate=cpu memory pids,DelegateSubgroup=supervisor, its controllers enabled, andQQ_TEST_CGROUP_ROOTpointing to that service's delegated root. Ordinary CI without delegation exercises refusal, not positive resource qualification.Fourth layer after #404. Auto still selects host authority. Shared task/server budgets, disk capacity, hardlink isolation, credential brokering, authorized egress and macOS/Windows containment remain before Auto enablement. No comparative performance claim.