Skip to content

Conversation

@hajnalmt
Copy link
Contributor

@hajnalmt hajnalmt commented Sep 26, 2025

The checking functions in the cache utils has ambiguous logging entries:
I0925 07:48:34.403937 5756 util.go:79] schedulerPodName is responsible to Node k3d-volcano-dev-agent-2

Since in single scheduler scenarios the schedulerPodname is not populated. These entries are intimidating, because:

  • It's not clear that we are in caching territory so no things to be afraid.
  • Looks weird that there is an empty string after schedulerPodName.

Furthermore, if it's empty the consistent hash circle is not needed to be checked.

What type of PR is this?

/kind bug

What this PR does / why we need it:

Minor improvement in caching.
Adding this check is preventing the responsibility functions to go on.

Which issue(s) this PR fixes:

Fixes #4646

Special notes for your reviewer:

The reason why it's empty is laying in the multi-scheduler implementation based on consistency hashes:
https://github.com/volcano-sh/volcano/blob/master/docs/design/deploy-multi-volcano-schedulers-without-using-selector.md
Implemented in this PR:
#1795
We get the env vars out in cache.go:
https://github.com/volcano-sh/volcano/blob/master/pkg/scheduler/cache/cache.go#L542
But it is an empty string since it's not specified:
https://github.com/volcano-sh/volcano/blob/master/pkg/scheduler/cache/util.go#L106
This is most of the cases as we don't support this config through the helm chart yet. See:
#4645

Does this PR introduce a user-facing change?

NONE

@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 @hajnalmt, 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 cache utility functions by improving logging and optimizing logic for single-scheduler environments. It resolves misleading log messages that appear when the schedulerPodName is not set, and prevents redundant consistent hashing checks in such scenarios, ensuring that the scheduler correctly identifies its responsibility for pods, nodes, and pod groups without unnecessary overhead.

Highlights

  • Logging Clarity: Addresses ambiguous logging entries in cache util functions that appear when schedulerPodName is not populated, which can be misleading in single-scheduler setups. New log messages clarify that these are not multi-scheduler scenarios.
  • Performance Optimization: Prevents unnecessary consistent hash circle checks in responsibleForPod, responsibleForNode, and responsibleForPodGroup functions when mySchedulerPodName is empty, as these checks are only relevant for multi-scheduler scenarios.
  • Conditional Logic: Introduces early exit conditions in responsibleForPod, responsibleForNode, and responsibleForPodGroup to return true immediately if mySchedulerPodName is not specified, indicating that the current scheduler is responsible in a single-scheduler context.
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 Sep 26, 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 correctly addresses the ambiguous logging in single-scheduler scenarios by adding checks for an empty schedulerPodName in the responsibleFor... utility functions. The changes are clear and prevent unnecessary consistent hash lookups. I've added one suggestion to refactor the duplicated logic into a helper function to improve code maintainability.

The checking functions in the cache utils had ambiguous logging entries:
I0925 07:48:34.403937    5756 util.go:79] schedulerPodName  is responsible to Node k3d-volcano-dev-agent-2

Since in single scheduler scenarios the schedulerPodname is not
populated. These entries are intimidating, because:
- It's not clear that we are in caching territory so no things to
be afraid.
- Looks weird that there is an empty string after schedulerPodName.

Furthermore, if it's empty the consistent hash circle is not needed
to be checked.

Signed-off-by: Hajnal Máté <[email protected]>
@hajnalmt hajnalmt force-pushed the schedulerPodName-log-line-fixes branch from 1ef5ed1 to cb15d16 Compare September 30, 2025 13:25
@hajnalmt
Copy link
Contributor Author

/assign @Thor-wl

@volcano-sh-bot volcano-sh-bot added the kind/bug Categorizes issue or PR as related to a bug. label Sep 30, 2025
@hajnalmt
Copy link
Contributor Author

hajnalmt commented Oct 1, 2025

/cc @JesseStutler
/cc @Monokaix

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

Labels

kind/bug Categorizes issue or PR as related to a bug. 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.

schedulerPodName ambiguous log entry

3 participants