Skip to content

fix: handle no memory limit in coder stat mem #11107

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 4 commits into from
Dec 8, 2023
Merged

fix: handle no memory limit in coder stat mem #11107

merged 4 commits into from
Dec 8, 2023

Conversation

f0ssel
Copy link
Contributor

@f0ssel f0ssel commented Dec 8, 2023

Closes #10952

When running ./scripts/develop.sh in dogfood I noticed this unreasonably high number for memory limit. After some digging (https://unix.stackexchange.com/questions/420906/what-is-the-value-for-the-cgroups-limit-in-bytes-if-the-memory-is-not-restricte) I found out that this number is used by docker to effectively use unlimited memory for the container.

Copy link
Member

@johnstcn johnstcn left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice find! Can you add a unit test for this?

@f0ssel
Copy link
Contributor Author

f0ssel commented Dec 8, 2023

Simplified the behavior to just return -1, and added a unit test

@f0ssel f0ssel merged commit d8467c1 into main Dec 8, 2023
@f0ssel f0ssel deleted the f0ssel/stat-mem branch December 8, 2023 17:46
@github-actions github-actions bot locked and limited conversation to collaborators Dec 8, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

coder stat returns wrong memory units
2 participants