-
Notifications
You must be signed in to change notification settings - Fork 1.2k
[draft] skip root level check for job enqueue #4680
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
base: master
Are you sure you want to change the base?
Conversation
|
Welcome @mtian29! |
|
[APPROVALNOTIFIER] This PR is NOT APPROVED This pull-request has been approved by: The full list of commands accepted by this bot can be found here.
Needs approval from an approver in each of these files:
Approvers can indicate their approval by writing |
Summary of ChangesHello @mtian29, I'm Gemini Code Assist1! I'm currently reviewing this pull request and will post my feedback shortly. In the meantime, here's a summary to help you and other reviewers quickly get up to speed! This pull request refines the job enqueueing process within the scheduler's capacity plugin by introducing an exception for the root queue. Instead of performing a capacity check at the root level, jobs are now allowed to enqueue directly, with the expectation that resource allocation and potential preemption will be handled by the reclaim mechanism. This change aims to streamline the initial placement of jobs and prevent unnecessary blocking at the top-level queue. Highlights
Using Gemini Code AssistThe full guide for Gemini Code Assist can be found on our documentation page, here are some quick tips. Invoking Gemini You can request assistance from Gemini at any point by creating a comment using either
Customization To customize Gemini Code Assist for GitHub experience, repository maintainers can create a configuration file and/or provide a custom code review style guide (such as PEP-8 for Python) by creating and adding files to a Limitations & Feedback Gemini Code Assist may make mistakes. Please leave feedback on any instances where its feedback is incorrect or counter productive. You can react with 👍 and 👎 on @gemini-code-assist comments. If you're interested in giving your feedback about your experience with Gemini Code Assist for Github and other Google products, sign up here. You can also get AI-powered code generation, chat, as well as code reviews directly in the IDE at no cost with the Gemini Code Assist IDE Extension. Footnotes
|
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.
Code Review
This pull request introduces a change to the capacity plugin to skip capacity checks for the root queue during job enqueueing, allowing reclaim to handle preemption. The review focuses on the correctness and potential implications of this change.
| // Skip capacity check for root queue - allow enqueue and let reclaim handle preemption | ||
| if cp.queueOpts[list[i]].name == cp.rootQueue { | ||
| klog.V(4).Infof("Skip capacity check for root queue, allow job <%s/%s> to enqueue for potential reclaim", job.Namespace, job.Name) | ||
| continue | ||
| } |
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 change skips the capacity check for the root queue. While this might be intended to allow reclaim to handle preemption, it's crucial to ensure that this doesn't lead to over-commitment of resources at the root level, potentially starving other queues or causing unexpected behavior. It would be helpful to add more logging to track when and why this condition is being triggered, and to monitor the resource usage of the root queue more closely.
Consider adding a metric to track how often this condition is met, to ensure that it is not happening more often than expected.
| if cp.queueOpts[list[i]].name == cp.rootQueue { | ||
| klog.V(4).Infof("Skip capacity check for root queue, allow job <%s/%s> to enqueue for potential reclaim", job.Namespace, job.Name) | ||
| continue |
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.
Consider extracting the condition cp.queueOpts[list[i]].name == cp.rootQueue into a well-named variable to improve readability. This will make the code easier to understand at a glance.
Also, consider adding a comment explaining why level 4 logging is used here.
currentQueueName := cp.queueOpts[list[i]].name
// Skip capacity check for root queue - allow enqueue and let reclaim handle preemption
if currentQueueName == cp.rootQueue {
klog.V(4).Infof("Skip capacity check for root queue, allow job <%s/%s> to enqueue for potential reclaim", job.Namespace, job.Name)
continue
}
What type of PR is this?
#4679
apply same idea to checkHierarchicalQueue can fix #4684 too
What this PR does / why we need it:
Which issue(s) this PR fixes:
Fixes #
Special notes for your reviewer:
Does this PR introduce a user-facing change?