-
Notifications
You must be signed in to change notification settings - Fork 6k
cgmon: fix the issue that CPU quota is 0 if it's not limited by cgroup #61322
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
Conversation
Ref #50468 |
ctx context.Context | ||
cancel context.CancelFunc | ||
wg sync.WaitGroup | ||
cfgMaxProcs int |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This variable is not used. I don't know why it was here before.
} | ||
|
||
if quota != lastMaxProcs { | ||
if quota != lastCPU { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Just a rename. Because it's actually not GOMAXPROCS
, it's NumCPU
.
e5fd8ca
to
64d3cf6
Compare
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## master #61322 +/- ##
================================================
+ Coverage 73.1942% 73.6258% +0.4315%
================================================
Files 1726 1726
Lines 478576 479082 +506
================================================
+ Hits 350290 352728 +2438
+ Misses 106833 104949 -1884
+ Partials 21453 21405 -48
Flags with carried forward coverage won't be shown. Click here to find out more.
🚀 New features to boost your workflow:
|
/retest |
Signed-off-by: Yang Keao <[email protected]>
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: Defined2014, hawkingrei The full list of commands accepted by this bot can be found here. The pull request process is described here
Needs approval from an approver in each of these files:
Approvers can indicate their approval by writing |
[LGTM Timeline notifier]Timeline:
|
What problem does this PR solve?
Issue Number: close #61223
Problem Summary:
The cpu quota will always be 0 if it failed to get the cgroup limit. The same issue also exists for memory.
What changed and how does it work?
Change the logic of error handling in cgmon. Make the cpu quota defaults to the count of CPU, and the memory quota defaults to the memory get from
/proc/meminfo
. Then update these values according to the cgroup settings.Check List
Tests
Side effects
Documentation
Release note
Please refer to Release Notes Language Style Guide to write a quality release note.