Cap gate command resources#138
Conversation
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: ba8ee1cd33
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
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".
| if (limit.rlim_max == RLIM_INFINITY || limit.rlim_max > maximum) { | ||
| limit.rlim_cur = maximum; | ||
| limit.rlim_max = maximum; | ||
| } else { | ||
| limit.rlim_cur = limit.rlim_max; |
There was a problem hiding this comment.
Preserve lower inherited soft limits
When the caller has already lowered a soft rlimit below these new caps while leaving the hard limit higher (for example a CI wrapper using a lower soft CPU or file-size limit), this code overwrites rlim_cur with maximum or the inherited hard value. That makes every sandboxed command start with more budget than the invoking environment's current limit, so the claimed preservation of lower inherited ceilings is bypassed in those runs; clamp the new hard/soft values against the inherited soft limit as well if lower caller limits should remain effective.
Useful? React with 👍 / 👎.
Summary
Verification
scripts/ci/check-repositoryResidual risk
Rollback
Revert this commit to remove the helper resource ceilings and related policy, tests, and documentation.