fix: clamp memory reported in cgroup v1 reports#8841
Merged
dmadisetti merged 1 commit intomainfrom Mar 24, 2026
Merged
Conversation
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
1 task
Contributor
There was a problem hiding this comment.
Pull request overview
Addresses incorrect container memory reporting on cgroup v1 systems (e.g., older WSL2) where memory.limit_in_bytes can be a near-LONG_MAX sentinel value, by treating extremely large limits as “unlimited” and adding targeted tests around cgroup v1/v2 memory parsing.
Changes:
- Add an “unlimited” threshold check for cgroup v1
memory.limit_in_bytesand returnNonewhen the sentinel/oversized value is detected. - Introduce unit tests that mock cgroup v1/v2 files to validate unlimited vs. real-limit behavior.
- Export/use cgroup file path constants in tests for consistent mocking.
Reviewed changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated 2 comments.
| File | Description |
|---|---|
marimo/_utils/health.py |
Adds a cgroup v1 “unlimited” threshold and short-circuits to None when the reported limit is unrealistically large. |
tests/_utils/test_health_utils.py |
Adds mocked-file tests for cgroup v1 sentinel limits, real limits, and cgroup v2 max. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
mscolnick
approved these changes
Mar 23, 2026
|
🚀 Development release published. You may be able to view the changes at https://marimo.app?v=0.21.2-dev43 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
📝 Summary
closes #8639
On cgroup v1 (common in older WSL2),
memory.limit_in_bytesreports a value near LONG_MAX~9.2×10^18. This PR clamps the total reported memory to 1 exabyte.NB cgroup v2 seems to report just
max. Unable to directly reproduce the reported issue, but this seems like a reasonable work around.