Skip to content

fix: handle cgroup v2 'max' string in memory guard - #2171

Closed
Battleplus wants to merge 1 commit into
unclecode:mainfrom
Battleplus:fix/2123-cgroup-v2-max-memory
Closed

fix: handle cgroup v2 'max' string in memory guard#2171
Battleplus wants to merge 1 commit into
unclecode:mainfrom
Battleplus:fix/2123-cgroup-v2-max-memory

Conversation

@Battleplus

Copy link
Copy Markdown

Fixes #2123. When cgroup v2 has no memory limit, memory.max contains 'max' string. int('max') raises ValueError, caught by bare except, returning host memory % instead of container. Fix: parse 'max' as unlimited.

@Battleplus

Copy link
Copy Markdown
Author

Duplicate of #2154. Keeping #2154 as the canonical fix because it handles the cgroup v2 literal "max" correctly while preserving v1/numeric behavior and includes regression coverage.

@Battleplus Battleplus closed this Aug 21, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Bug]: Docker memory guard reads host RAM when no container limit is set — cgroup v2 "max" defeats get_container_memory_percent

1 participant