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

[YUNIKORN-2661] Fix hard-coded boolean in setLimit #883

Closed
wants to merge 2 commits into from

Conversation

pbacsko
Copy link
Contributor

@pbacsko pbacsko commented Jun 3, 2024

What is this PR for?

Remove the hard coded "false" value for setLimit() in the recursive call.

What type of PR is it?

  • - Bug Fix
  • - Improvement
  • - Feature
  • - Documentation
  • - Hot Fix
  • - Refactoring

Todos

  • - Task

What is the Jira issue?

https://issues.apache.org/jira/browse/YUNIKORN-2661

How should this be tested?

Screenshots (if appropriate)

Questions:

  • - The licenses files need update.
  • - There is breaking changes for older versions.
  • - It needs documentation.

@pbacsko pbacsko self-assigned this Jun 3, 2024
@pbacsko pbacsko requested a review from manirajv06 June 3, 2024 12:49
Comment on lines 348 to 361
newLimit := resources.NewResourceFromMap(map[string]resources.Quantity{
"mem": 20,
"vcore": 20})
root.setLimit(strings.Split(queuePath1, configs.DOT), newLimit.Clone(), 3, false, user, true) // override
assert.Assert(t, resources.Equals(newLimit, childQ.maxResources))
newLimit2 := resources.NewResourceFromMap(map[string]resources.Quantity{
"mem": 30,
"vcore": 30})
root.setLimit(strings.Split(queuePath1, configs.DOT), newLimit2.Clone(), 3, true, user, true) // no override
assert.Assert(t, resources.Equals(newLimit, childQ.maxResources))
root.setLimit(strings.Split(queuePath1, configs.DOT), newLimit2.Clone(), 3, true, user, false) // override -> changes qt.doWildCardCheck
assert.Assert(t, resources.Equals(newLimit2, childQ.maxResources))
root.setLimit(strings.Split(queuePath1, configs.DOT), newLimit2.Clone(), 3, false, user, false) // no override
assert.Assert(t, resources.Equals(newLimit2, childQ.maxResources))
Copy link
Contributor Author

Choose a reason for hiding this comment

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

@manirajv06 please check this test logic, I'm not 100% sure that I understand what's going on inside the QueueTracker.

Copy link

codecov bot commented Jun 3, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 77.64%. Comparing base (de77408) to head (1299fc9).
Report is 7 commits behind head on master.

Additional details and impacted files
@@            Coverage Diff             @@
##           master     #883      +/-   ##
==========================================
+ Coverage   77.34%   77.64%   +0.29%     
==========================================
  Files          97       97              
  Lines       12132    12119      -13     
==========================================
+ Hits         9384     9410      +26     
+ Misses       2417     2387      -30     
+ Partials      331      322       -9     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

pkg/scheduler/ugm/queue_tracker_test.go Show resolved Hide resolved
pkg/scheduler/ugm/queue_tracker_test.go Show resolved Hide resolved
assert.Assert(t, resources.Equals(newLimit, childQ.maxResources))
root.setLimit(strings.Split(queuePath1, configs.DOT), newLimit2.Clone(), 3, true, user, false) // override -> changes qt.doWildCardCheck
assert.Assert(t, resources.Equals(newLimit2, childQ.maxResources))
root.setLimit(strings.Split(queuePath1, configs.DOT), newLimit2.Clone(), 3, false, user, false) // no override
Copy link
Contributor

Choose a reason for hiding this comment

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

Same limit (newLimit2) has applied here too. So how do we ensure override really happens or not?

useWildCard flag helps to know whether wild card user (*) settings has applied for that specific user or not. True means applied, false means no. In case user specific settings applied for that specific use, useWildcard flag is "no".

doWildCheck is required only when we are trying to clear or reset wild card user settings for all existing users not clearing or resetting user specific settings for that specific user. For example, When config had settings for wild card user (*) earlier but not now. Before clearing/reset settings for specific user object, there is a need to pass this flag to do the actual clearance.

Copy link
Contributor

@wilfred-s wilfred-s left a comment

Choose a reason for hiding this comment

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

LGTM, @manirajv06 please check the requested changes were added.

Copy link
Contributor

@manirajv06 manirajv06 left a comment

Choose a reason for hiding this comment

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

looks good.

@pbacsko pbacsko closed this in 1aafed0 Jun 24, 2024
pbacsko added a commit that referenced this pull request Jun 24, 2024
Closes: #883

Signed-off-by: Peter Bacsko <pbacsko@cloudera.com>
(cherry picked from commit 1aafed0)
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.

3 participants