Skip to content
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

Fix automax.SetMem on cgroupv1 systems #148

Merged
merged 1 commit into from
Oct 4, 2022
Merged

Fix automax.SetMem on cgroupv1 systems #148

merged 1 commit into from
Oct 4, 2022

Conversation

xvello
Copy link
Contributor

@xvello xvello commented Oct 4, 2022

On an ubuntu 20.04 system (cgroupv1 system), SetMem failed silently to parse the limit from the cgroup file. This is because the file contents actually end with a newline character, that leads strconv.ParseInt to fail. Updated the test fixture accordingly.

I did not test on a cgroupv2 system, but my experience is that all these files end with a newline anyway, so I put the strings.TrimSpace in the common code path to be sure.

@komuw komuw merged commit ae95e0b into komuw:main Oct 4, 2022
@komuw
Copy link
Owner

komuw commented Oct 4, 2022

Thank you!

@xvello xvello deleted the xvello/fix-automax branch October 4, 2022 16:55
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.

2 participants