Skip to content

Conversation

@skools-here
Copy link

@skools-here skools-here commented Dec 30, 2025

What type of PR is this?

/kind bug

What this PR does / why we need it:

Fixes cleanup of the second-pass scheduling queue by ensuring workloads are removed once they no longer require a retry, while preserving the initial backoff behavior.

Which issue(s) this PR fixes:

Fixes #8357

Special notes for your reviewer:

Cleanup is gated on retry iteration to avoid prematurely canceling the initial backoff window.

Does this PR introduce a user-facing change?

Fixed an issue where workloads could remain in the second-pass scheduling queue after they no longer required a retry.

@k8s-ci-robot k8s-ci-robot added kind/bug Categorizes issue or PR as related to a bug. do-not-merge/release-note-label-needed Indicates that a PR should not merge because it's missing one of the release note labels. labels Dec 30, 2025
@netlify
Copy link

netlify bot commented Dec 30, 2025

Deploy Preview for kubernetes-sigs-kueue canceled.

Name Link
🔨 Latest commit 4c1698c
🔍 Latest deploy log https://app.netlify.com/projects/kubernetes-sigs-kueue/deploys/69625e00dd751400086ea1b3

@k8s-ci-robot
Copy link
Contributor

Welcome @skools-here!

It looks like this is your first PR to kubernetes-sigs/kueue 🎉. Please refer to our pull request process documentation to help your PR have a smooth ride to approval.

You will be prompted by a bot to use commands during the review process. Do not be afraid to follow the prompts! It is okay to experiment. Here is the bot commands documentation.

You can also check if kubernetes-sigs/kueue has its own contribution guidelines.

You may want to refer to our testing guide if you run into trouble with your tests not passing.

If you are having difficulty getting your pull request seen, please follow the recommended escalation practices. Also, for tips and tricks in the contribution process you may want to read the Kubernetes contributor cheat sheet. We want to make sure your contribution gets all the attention it needs!

Thank you, and welcome to Kubernetes. 😃

@k8s-ci-robot k8s-ci-robot added the needs-ok-to-test Indicates a PR that requires an org member to verify it is safe to test. label Dec 30, 2025
@k8s-ci-robot
Copy link
Contributor

Hi @skools-here. Thanks for your PR.

I'm waiting for a github.com member to verify that this patch is reasonable to test. If it is, they should reply with /ok-to-test on its own line. Until that is done, I will not automatically test new commits in this PR, but the usual testing commands by org members will still work. Regular contributors should join the org to skip this step.

Once the patch is verified, the new status will be reflected by the ok-to-test label.

I understand the commands that are listed here.

Details

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-sigs/prow repository.

@k8s-ci-robot k8s-ci-robot added size/XS Denotes a PR that changes 0-9 lines, ignoring generated files. cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. labels Dec 30, 2025
@mbobrovskyi
Copy link
Contributor

/ok-to-test

@k8s-ci-robot k8s-ci-robot added ok-to-test Indicates a non-member PR verified by an org member that is safe to test. and removed needs-ok-to-test Indicates a PR that requires an org member to verify it is safe to test. labels Dec 30, 2025
@skools-here
Copy link
Author

/retest-required

Copy link
Contributor

@gabesaba gabesaba left a comment

Choose a reason for hiding this comment

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

Thanks for the fix! I just have a small nitpick comment

/approve

})
return true
}
if !workload.NeedsSecondPass(w) && iteration > 0 {
Copy link
Contributor

@gabesaba gabesaba Jan 8, 2026

Choose a reason for hiding this comment

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

nit: else-if, and add a short comment to document this branch?

Suggested change
if !workload.NeedsSecondPass(w) && iteration > 0 {
else if iteration > 0 {
// some comment, including link to #8357

@k8s-ci-robot
Copy link
Contributor

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: gabesaba, skools-here

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

The pull request process is described here

Details 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 8, 2026
@gabesaba
Copy link
Contributor

gabesaba commented Jan 8, 2026

And please update the release-note

@skools-here
Copy link
Author

Hey @gabesaba I fixed the changes and added release notes also kindly review!

@k8s-ci-robot k8s-ci-robot added release-note Denotes a PR that will be considered when it comes time to generate release notes. and removed do-not-merge/release-note-label-needed Indicates that a PR should not merge because it's missing one of the release note labels. labels Jan 8, 2026
// QueueSecondPassIfNeeded queues for the second pass of scheduling with exponential
// delay.
func (m *Manager) QueueSecondPassIfNeeded(ctx context.Context, w *kueue.Workload, iteration int) bool {
log := ctrl.LoggerFrom(ctx)
Copy link
Contributor

@mimowo mimowo Jan 8, 2026

Choose a reason for hiding this comment

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

Could you please add some unit test for that changes in, probably in TestQueueSecondPassIfNeeded?

Copy link
Author

Choose a reason for hiding this comment

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

Thanks! I’ll add unit coverage for this case and update the PR.

@gabesaba
Copy link
Contributor

gabesaba commented Jan 8, 2026

Hey @gabesaba I fixed the changes and added release notes also kindly review!

thank you! will wait for @mimowo's comment to be addressed.

@k8s-ci-robot k8s-ci-robot added size/S Denotes a PR that changes 10-29 lines, ignoring generated files. and removed size/XS Denotes a PR that changes 0-9 lines, ignoring generated files. labels Jan 8, 2026
@skools-here
Copy link
Author

Hey @gabesaba I fixed the changes and added release notes also kindly review!

thank you! will wait for @mimowo's comment to be addressed.

I have completed what @mimowo said kindly take a look !

@skools-here
Copy link
Author

/test pull-kueue-test-e2e-main-1-35

@skools-here
Copy link
Author

The e2e job pull-kueue-test-e2e-main-1-35 failed twice without a test assertion failure. Unit tests and lint are passing locally. This seems like an infra flake.

@gabesaba
Copy link
Contributor

This seems like an infra flake.

I think so too

Error response from daemon: Head "https://registry.k8s.io/v2/jobset/jobset/manifests/v0.10.1": dial tcp 34.96.108.209:443: i/o timeout

/retest

Comment on lines 1459 to 1465
if name == "workload no longer needs second pass after first iteration" {
manager.QueueSecondPassIfNeeded(
ctx,
baseWorkloadNotNeedingSecondPass.DeepCopy(),
1,
)
}
Copy link
Contributor

Choose a reason for hiding this comment

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

This is an anti-pattern - having a special case in the shared test logic for one of the test cases.

Additionally, are we testing in this case that the new logic works? I don't see anything which changes whether the 2nd pass is needed, nor checks if it is removed from the queue.

We might need another test fixture to test this. Let me know if you need help (though I'm OOO monday)

@k8s-ci-robot k8s-ci-robot added size/M Denotes a PR that changes 30-99 lines, ignoring generated files. and removed size/S Denotes a PR that changes 10-29 lines, ignoring generated files. labels Jan 10, 2026
@k8s-ci-robot
Copy link
Contributor

@skools-here: The following test failed, say /retest to rerun all failed tests or /retest-required to rerun all mandatory failed tests:

Test name Commit Details Required Rerun command
pull-kueue-test-unit-main 4c1698c link true /test pull-kueue-test-unit-main

Full PR test history. Your PR dashboard. Please help us cut down on flakes by linking to an open issue when you hit one in your PR.

Details

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-sigs/prow repository. I understand the commands that are listed here.

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. ok-to-test Indicates a non-member PR verified by an org member that is safe to test. release-note Denotes a PR that will be considered when it comes time to generate release notes. size/M Denotes a PR that changes 30-99 lines, ignoring generated files.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

TAS NodeHotSwap: make sure QueueSecondPassIfNeeded removes workload from second-queue pass if no longer needed

5 participants