-
Notifications
You must be signed in to change notification settings - Fork 1.3k
[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?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -886,7 +886,15 @@ func (cp *capacityPlugin) checkJobEnqueueableHierarchically(ssn *framework.Sessi | |
| list := append(cp.queueOpts[queue.UID].ancestors, queue.UID) | ||
| // Check whether the job can be enqueued to the queue and all its ancestors. | ||
| for i := len(list) - 1; i >= 0; i-- { | ||
| if inqueue, resourceNames := cp.jobEnqueueable(ssn.Queues[list[i]], job); !inqueue { | ||
| currentQueue := ssn.Queues[list[i]] | ||
|
|
||
| // 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 | ||
| } | ||
|
Comment on lines
+891
to
+895
There was a problem hiding this comment. Choose a reason for hiding this commentThe 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 inqueue, resourceNames := cp.jobEnqueueable(currentQueue, job); !inqueue { | ||
| // If log level is 5, print the information of all queues from leaf to ancestor. | ||
| if klog.V(5).Enabled() { | ||
| for j := i - 1; j >= 0; j-- { | ||
|
|
||
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.rootQueueinto 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.