Make sandbox child nproc limit configurable#1497
Conversation
|
See comment here |
|
Thanks, that makes sense. My current revision still leaves too much ownership of the PID budget in the supervisor by defaulting to a larger/configurable RLIMIT_NPROC. I’ll revise the PR to align with the compute-driver model instead:
I’ll rebase this branch, move the setting/enforcement toward the driver/runtime layer, keep the supervisor side to detection/guardrail behavior, and add tests for cgroup pids.max parsing plus the warn/refuse path. |
bcca74f to
7a7e017
Compare
|
Updated the branch in What changed:
Validation:
One local caveat: full |
Signed-off-by: mjamiv <142179942+mjamiv@users.noreply.github.com>
7a7e017 to
b1299cc
Compare
|
/ok to test b1299cc |
derekwaynecarr
left a comment
There was a problem hiding this comment.
thank you for updating to align with compute driver and cgroup pid enforcement.
Summary
Make the sandbox child
RLIMIT_NPROCconfigurable through the existing settings system while keeping the default fleet-safe limit at4096.Why
RLIMIT_NPROCis accounted by real UID on Linux. In shared-UID sandbox fleets, a fixed512limit can be exhausted by aggregate legitimate workload. At the same time, different runtimes and deployments may already enforce PID/process budgets and should be able to inherit those limits instead of OpenShell overriding them.Changes
sandbox_child_nproc_limitsetting.4096child-process limit.RLIMIT_NPROC.0to skip theRLIMIT_NPROCoverride and inherit the container/runtime limit.Validation
cargo fmt --checkgit diff --checkcargo test -p openshell-core settingscargo test -p openshell-cli --lib parse_cli_setting_valuecargo test -p openshell-sandbox harden_child_processcargo test -p openshell-sandbox sandbox_child_nproc_limit