Skip to content
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

Fix kueue crashing when clearing outdated assignment on log level 6 #1644

Conversation

mimowo
Copy link
Contributor

@mimowo mimowo commented Jan 25, 2024

What type of PR is this?

/kind bug
/kind regression

What this PR does / why we need it:

Kueue is crashing currently when the log is at level 6.

This is the error log:

goroutine 481 [running]:
k8s.io/apimachinery/pkg/util/runtime.HandleCrash({0x0, 0x0, 0x175e3ae?})
	/go/pkg/mod/k8s.io/apimachinery@v0.28.6/pkg/util/runtime/runtime.go:56 +0xcd
panic({0x22b8780?, 0x3fa68e0?})
	/usr/local/go/src/runtime/panic.go:914 +0x21f
sigs.k8s.io/kueue/pkg/scheduler/flavorassigner.AssignFlavors({{0x2a96818?, 0xc000a64360?}, 0x14?}, 0xc000f9bc00, 0x4?, 0xc0011541e0, {0x0, 0x0, 0xc001805880?})
	/workspace/pkg/scheduler/flavorassigner/flavorassigner.go:245 +0x220
sigs.k8s.io/kueue/pkg/scheduler.(*Scheduler).getAssignments(0xc0007c6780, {{0x2a96818?, 0xc000a64360?}, 0xc000a64270?}, 0xc000f9bc00, 0xc000ebb838)
	/workspace/pkg/scheduler/scheduler.go:382 +0xf5
sigs.k8s.io/kueue/pkg/scheduler.(*Scheduler).nominate(0xc0007c6780, {0x2a8fac8, 0xc000c9e090}, {0xc001513ac0, 0x1, 0xd?}, {0xc000a64060, 0xc000a64090, 0xc000a640c0})
	/workspace/pkg/scheduler/scheduler.go:334 +0x931
sigs.k8s.io/kueue/pkg/scheduler.(*Scheduler).schedule(0xc0007c6780, {0x2a8fac8, 0xc000c9e090})
	/workspace/pkg/scheduler/scheduler.go:191 +0x166
k8s.io/apimachinery/pkg/util/wait.JitterUntilWithContext.func1()
	/go/pkg/mod/k8s.io/apimachinery@v0.28.6/pkg/util/wait/backoff.go:259 +0x22
k8s.io/apimachinery/pkg/util/wait.BackoffUntil.func1(0xc000ebbe80?)
	/go/pkg/mod/k8s.io/apimachinery@v0.28.6/pkg/util/wait/backoff.go:226 +0x33
k8s.io/apimachinery/pkg/util/wait.BackoffUntil(0x0?, {0x2a69100, 0xc000c9e0c0}, 0x1, 0xc000c2e000)
	/go/pkg/mod/k8s.io/apimachinery@v0.28.6/pkg/util/wait/backoff.go:227 +0xaf
k8s.io/apimachinery/pkg/util/wait.JitterUntil(0x2a8fb00?, 0x0, 0x0, 0x0?, 0x0?)
	/go/pkg/mod/k8s.io/apimachinery@v0.28.6/pkg/util/wait/backoff.go:204 +0x7f
k8s.io/apimachinery/pkg/util/wait.JitterUntilWithContext({0x2a8fac8, 0xc000c9e090}, 0xc000ca0000, 0xc0007c42d0?, 0xcc516e?, 0xd0?)
	/go/pkg/mod/k8s.io/apimachinery@v0.28.6/pkg/util/wait/backoff.go:259 +0x93
k8s.io/apimachinery/pkg/util/wait.UntilWithContext({0x2a8fac8?, 0xc000c9e090?}, 0x17d4907?, 0xc0006b2240?)
	/go/pkg/mod/k8s.io/apimachinery@v0.28.6/pkg/util/wait/backoff.go:170 +0x25
created by sigs.k8s.io/kueue/pkg/scheduler.(*Scheduler).Start in goroutine 394
	/workspace/pkg/scheduler/scheduler.go:119 +0x13a

Which issue(s) this PR fixes:

Fixes #

Special notes for your reviewer:

Does this PR introduce a user-facing change?

Fix Kueue crashing at the log level 6 when re-admitting workloads

@k8s-ci-robot k8s-ci-robot added release-note Denotes a PR that will be considered when it comes time to generate release notes. kind/bug Categorizes issue or PR as related to a bug. kind/regression Categorizes issue or PR as related to a regression from a prior release. cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. labels Jan 25, 2024
Copy link

netlify bot commented Jan 25, 2024

Deploy Preview for kubernetes-sigs-kueue ready!

Name Link
🔨 Latest commit a26bd79
🔍 Latest deploy log https://app.netlify.com/sites/kubernetes-sigs-kueue/deploys/65b278cecd8bd400084e6098
😎 Deploy Preview https://deploy-preview-1644--kubernetes-sigs-kueue.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify site configuration.

@k8s-ci-robot k8s-ci-robot added the size/XS Denotes a PR that changes 0-9 lines, ignoring generated files. label Jan 25, 2024
@mimowo
Copy link
Contributor Author

mimowo commented Jan 25, 2024

/assign @tenzen-y @alculquicondor

Copy link
Member

@tenzen-y tenzen-y left a comment

Choose a reason for hiding this comment

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

Nice catch :)

/lgtm
/approve

@k8s-ci-robot k8s-ci-robot added the lgtm "Looks good to me", indicates that a PR is ready to be merged. label Jan 25, 2024
@k8s-ci-robot
Copy link
Contributor

LGTM label has been added.

Git tree hash: a16044797d89027dd110a95eb9d35318526c75e7

@k8s-ci-robot
Copy link
Contributor

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: mimowo, tenzen-y

The full list of commands accepted by this bot can be found here.

The pull request process is described 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

@k8s-ci-robot k8s-ci-robot added the approved Indicates a PR has been approved by an approver from all required OWNERS files. label Jan 25, 2024
@@ -238,7 +238,6 @@ func lastAssignmentOutdated(wl *workload.Info, cq *cache.ClusterQueue) bool {
// FlavorAssignmentMode.
func AssignFlavors(log logr.Logger, wl *workload.Info, resourceFlavors map[kueue.ResourceFlavorReference]*kueue.ResourceFlavor, cq *cache.ClusterQueue, counts []int32) Assignment {
if wl.LastAssignment != nil && lastAssignmentOutdated(wl, cq) {
wl.LastAssignment = nil
Copy link
Contributor

Choose a reason for hiding this comment

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

/hold

Copy link
Contributor

Choose a reason for hiding this comment

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

ah it just moved below

/hold cancel

@k8s-ci-robot k8s-ci-robot added the do-not-merge/hold Indicates that a PR should not merge because someone has issued a /hold command. label Jan 25, 2024
@k8s-ci-robot k8s-ci-robot merged commit 855d6d9 into kubernetes-sigs:main Jan 25, 2024
14 checks passed
@k8s-ci-robot k8s-ci-robot added this to the v0.6 milestone Jan 25, 2024
@k8s-ci-robot k8s-ci-robot removed the do-not-merge/hold Indicates that a PR should not merge because someone has issued a /hold command. label Jan 25, 2024
@alculquicondor
Copy link
Contributor

I think this needs to be cherry-picked to 0.5?

@tenzen-y
Copy link
Member

Why is this PR merged in spite of /hold?

@tenzen-y
Copy link
Member

I think this needs to be cherry-picked to 0.5?

Yes, we should do it:

if wl.LastAssignment != nil && lastAssignmentOutdated(wl, cq) {
wl.LastAssignment = nil
if logV := log.V(6); logV.Enabled() {

@tenzen-y
Copy link
Member

/cherry-pick release-0.5

@k8s-infra-cherrypick-robot

@tenzen-y: new pull request created: #1645

In response to this:

/cherry-pick release-0.5

Instructions 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.

@alculquicondor
Copy link
Contributor

Why is this PR merged in spite of /hold?

Because the bot was not able to put the label on time.

@tenzen-y
Copy link
Member

Why is this PR merged in spite of /hold?

Because the bot was not able to put the label on time.

It makes sense.

@mimowo mimowo deleted the fix-kueue-crashing-on-reassigning-flavors branch February 10, 2024 11:47
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
approved Indicates a PR has been approved by an approver from all required OWNERS files. cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. kind/bug Categorizes issue or PR as related to a bug. kind/regression Categorizes issue or PR as related to a regression from a prior release. lgtm "Looks good to me", indicates that a PR is ready to be merged. release-note Denotes a PR that will be considered when it comes time to generate release notes. size/XS Denotes a PR that changes 0-9 lines, ignoring generated files.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

5 participants