-
Notifications
You must be signed in to change notification settings - Fork 1.2k
[release-1.13] Fix scheduler panic when metrics are disabled #4770
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
[release-1.13] Fix scheduler panic when metrics are disabled #4770
Conversation
Move InitKubeSchedulerRelatedMetrics() outside the EnableMetrics/EnablePprof conditional block to ensure k8smetrics.Goroutines is always initialized. This prevents panic when scheduler starts without --enable-metrics=true. Fixes #4729 (cherry-pick from #4731 to release-1.13) Co-authored-by: JesseStutler <38534065+JesseStutler@users.noreply.github.com>
|
Keywords which can automatically close issues and at(@) or hashtag(#) mentions are not allowed in commit messages. The list of commits with invalid commit messages:
DetailsInstructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository. I understand the commands that are listed here. |
|
/approve |
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.
Pull request overview
This PR is a manual cherry-pick of #4731 to the release-1.13 branch, fixing a nil pointer dereference panic that occurs when the volcano scheduler starts without the --enable-metrics=true flag. The Kubernetes scheduler framework plugins unconditionally access k8smetrics.Goroutines, which was previously only initialized inside a conditional block.
Key changes:
- Move
metrics.InitKubeSchedulerRelatedMetrics()outside the metrics/pprof conditional block to ensure it always executes - Add explanatory comment documenting why this initialization must always occur
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
|
/approve |
|
[APPROVALNOTIFIER] This PR is NOT APPROVED This pull-request has been approved by: JesseStutler The full list of commands accepted by this bot can be found here. DetailsNeeds approval from an approver in each of these files:Approvers can indicate their approval by writing |
What type of PR is this?
Bug fix (cherry-pick)
What this PR does / why we need it:
Manual cherry-pick of #4731 to release-1.13 branch.
Scheduler panics with nil pointer dereference when started without
--enable-metrics=true. The k8s scheduler framework plugins unconditionally accessk8smetrics.Goroutines, which was only initialized inside the metrics-enabled conditional block.Change: Move
metrics.InitKubeSchedulerRelatedMetrics()outside the conditional block sok8smetrics.Goroutinesis always initialized:Which issue(s) this PR fixes:
Fixes #4729
Special notes for your reviewer:
The panic occurs in
k8s.io/kubernetes/pkg/scheduler/framework/parallelize.Parallelizer.Untilwhen callingGoroutines.WithLabelValues()on nil. This metric must be initialized regardless of whether metrics export is enabled.Does this PR introduce a user-facing change?
Original prompt
💬 We'd love your input! Share your thoughts on Copilot coding agent in our 2 minute survey.