Wrap pending workloads bucket operations in helpers to keep scheduling hashes in sync - #14889
Conversation
… sync Encapsulate pending workloads bucket modifications (active, inadmissible, inflight) along with their scheduling equivalence hashes updates in helper methods. This prevents the scheduling equivalence hashes mirror from drifting out of sync with the buckets. Signed-off-by: Kavindu Sachinthe <kavix@yahoo.com>
✅ Deploy Preview for kubernetes-sigs-kueue ready!
To edit notification comments on pull requests, go to your Netlify project configuration. |
|
Hi @kavix. Thanks for your PR. I'm waiting for a kubernetes-sigs member to verify that this patch is reasonable to test. If it is, they should reply with Tip We noticed you've done this a few times! Consider joining the org to skip this step and gain Once the patch is verified, the new status will be reflected by the I understand the commands that are listed here. 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-sigs/prow repository. |
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Path: .coderabbit.yaml Review profile: CHILL Plan: Pro Plus Run ID: 📒 Files selected for processing (1)
Included review availability: Your plan provides up to 8 included reviews per hour; 6 remain after this review. 📝 WalkthroughWalkthrough
ChangesPending workload queue
Estimated code review effort: 2 (Simple) | ~10 minutes Merge Risk: ⚪ Minimal · up to This change centralizes pending-workload bucket updates with scheduling-hash metric updates; no actionable merge-blocking risk remains after normal checks and review. 🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
Full details: Docstring CoverageExplanation No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check. Docstring coverage is scoped to functions touched by this diff. Analyzed 0 functions across 1 files. ✨ Finishing Touches🧪 Generate unit tests (beta)
Comment |
|
Everything looks fine |
|
LGTM label has been added. DetailsGit tree hash: 8df9cd7f680e5b8d61e9d36755b6c45dda82cdcc |
|
/test all |
|
/ok-to-test |
mimowo
left a comment
There was a problem hiding this comment.
/approve
Thank you for this nice cleanup 👍 It is non trivial so I skip CP for now, but I think we can consider it if needed for other PRs
|
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: kavix, mimowo The full list of commands accepted by this bot can be found here. The pull request process is described here DetailsNeeds approval from an approver in each of these files:
Approvers can indicate their approval by writing |
|
/lgtm |
What type of PR is this?
/kind cleanup
What this PR does / why we need it:
The queue layer keeps pending workloads in three buckets (active, inadmissible, inflight), plus a mirror that counts their scheduling hashes for the
pending_scheduling_hashesmetric. Previously, whenever a workload moved between buckets or was added/removed/updated, the bucket and the mirror were updated as two separate calls acrosspkg/cache/queue/pending_workloads.go.This PR encapsulates each bucket mutation together with its scheduling equivalence hashes mirror update inside dedicated helper methods on
PendingWorkloads(addActive,updateActive,deleteActive,addInadmissible,updateInadmissible,deleteInadmissible,moveInadmissibleToActive,moveActiveToInadmissible,setInflight,clearInflight). This ensures that the buckets and mirror cannot be changed independently, preventing the metric from drifting out of sync.AI Disclosure: Assisted by Antigravity.
Which issue(s) this PR fixes:
Fixes #14877
Special notes for your reviewer:
Does this PR introduce a user-facing change?
Summary by CodeRabbit