Skip to content

Conversation

@mtian29
Copy link

@mtian29 mtian29 commented Oct 17, 2025

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?


@volcano-sh-bot
Copy link
Contributor

Welcome @mtian29!

It looks like this is your first PR to volcano-sh/volcano.

Thank you, and welcome to Volcano. 😃

@volcano-sh-bot
Copy link
Contributor

[APPROVALNOTIFIER] This PR is NOT APPROVED

This pull-request has been approved by:
To complete the pull request process, please assign thor-wl
You can assign the PR to them by writing /assign @thor-wl in a comment when ready.

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 /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@gemini-code-assist
Copy link

Summary of Changes

Hello @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

  • Job Enqueue Logic: Modified the checkJobEnqueueableHierarchically function to introduce a special handling for the root queue during job enqueue capacity checks.
  • Root Queue Capacity Check Bypass: Jobs will now bypass the capacity check when being enqueued to the root queue, allowing them to proceed and rely on the reclaim mechanism (preemption) to manage resource contention.
  • Logging Improvement: Added a klog informational message (V(4)) to indicate when the capacity check for the root queue is skipped for a job.
Using Gemini Code Assist

The 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 /gemini <command> or @gemini-code-assist <command>. Below is a summary of the supported commands on the current page.

Feature Command Description
Code Review /gemini review Performs a code review for the current pull request in its current state.
Pull Request Summary /gemini summary Provides a summary of the current pull request in its current state.
Comment @gemini-code-assist Responds in comments when explicitly tagged, both in pull request comments and review comments.
Help /gemini help Displays a list of available commands.

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 .gemini/ folder in the base of the repository. Detailed instructions can be found here.

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

  1. Review the Privacy Notices, Generative AI Prohibited Use Policy, Terms of Service, and learn how to configure Gemini Code Assist in GitHub here. Gemini can make mistakes, so double check it and use code with caution.

@volcano-sh-bot volcano-sh-bot added the size/S Denotes a PR that changes 10-29 lines, ignoring generated files. label Oct 17, 2025
@mtian29 mtian29 changed the title skip root level check for job enqueue [draft] skip root level check for job enqueue Oct 17, 2025
Copy link

@gemini-code-assist gemini-code-assist bot left a 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.

Comment on lines +891 to +895
// 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
}

Choose a reason for hiding this comment

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

high

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.

Comment on lines +892 to +894
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

Choose a reason for hiding this comment

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

medium

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
}

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

size/S Denotes a PR that changes 10-29 lines, ignoring generated files.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Scheduler do not work cause checkHierarchicalQueue failed when GPU dropped

2 participants