Repository navigation
fix(memory): honor nested cgroup limits (#3273) - #3273
Conversation
Problem: adaptive parsed-session caches observed host RAM from the root cgroup even when a systemd worker had a lower nested memory limit. A whale-bearing rebuild page could therefore size its cache beyond the worker envelope. What changed: discover memory-limit files along the current process's cgroup v2 or v1 ancestry and cap cache sizing by the tightest finite limit. Focused tests cover nested v2 path discovery and the effective host-limit cap. Co-Authored-By: Codex <[email protected]>
📝 WalkthroughWalkthrough
ChangesCgroup memory limit handling
Estimated code review effort: 3 (Moderate) | ~20 minutes Sequence Diagram(s)sequenceDiagram
participant effective_physical_memory_bytes
participant _cgroup_memory_limit_paths
participant cgroup_limit_files
effective_physical_memory_bytes->>_cgroup_memory_limit_paths: obtain ancestry limit paths
_cgroup_memory_limit_paths-->>effective_physical_memory_bytes: return candidate files
effective_physical_memory_bytes->>cgroup_limit_files: read finite memory limits
cgroup_limit_files-->>effective_physical_memory_bytes: return limit values
effective_physical_memory_bytes-->>effective_physical_memory_bytes: select minimum with host RAM
🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✨ Finishing Touches📝 Generate docstrings
🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 42ce0312e7
ℹ️ 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".
|
Historical Codex triage: evidence checked at 5ebcfe5. This records that source revision; it does not claim a fresh review of current master.
Only the rows listed above are dispositioned. Held findings remain open. |
Summary
Caps adaptive parsed-session cache sizing to the current process's actual cgroup hierarchy, including nested systemd service limits.
Problem
The cache-sizing helper read only root cgroup files. For a rebuild worker constrained by a nested 10 GiB systemd limit, it instead observed host RAM and could admit an 8 GiB whale cache alongside normal replay overhead.
Solution
Verification
Summary by CodeRabbit
Bug Fixes
Tests