Skip to content

Conversation

@alvaroaleman
Copy link
Member

@alvaroaleman alvaroaleman commented Oct 29, 2025

As described in #3363,
there are some circumstances under which GetWithPriority
is not returning the correct/expected element.

This can happen when a GetWithPriority is executed
and the Ascend of the queue is not completed yet,
causing not all the items of the BTree to evaluate
the same w.waiters.Load() value.

Adding a lock to manipulate the waiters will solve the issue.
Since the lock is required, there is no need to use an
atomic.Int64 anymore.

Cherry-pick of #3368

This cherry-pick does not include the corresponding test, because it uses synctest which is only available in go 1.25 and we use go 1.24 here. Given that all changes have to pass CI and be merged into main first, I think this is acceptable.

/assign @sbueringer

@k8s-ci-robot k8s-ci-robot added the cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. label Oct 29, 2025
@k8s-ci-robot k8s-ci-robot added approved Indicates a PR has been approved by an approver from all required OWNERS files. size/S Denotes a PR that changes 10-29 lines, ignoring generated files. labels Oct 29, 2025
As described in kubernetes-sigs#3363,
there are some circumstances under which `GetWithPriority`
is not returning the correct/expected element.

This can happen when a `GetWithPriority` is executed
and the `Ascend` of the queue is not completed yet,
causing not all the items of the BTree to evaluate
the same w.waiters.Load() value.

Adding a lock to manipulate the waiters will solve the issue.
Since the lock is required, there is no need to use an
atomic.Int64 anymore.

Signed-off-by: fossedihelm <[email protected]>
@fossedihelm
Copy link
Contributor

@alvaroaleman Can we backport this up to 0.20? And maybe ask for a 20.z release? Thank you!
Our k8s dependencies are still old :)

@alvaroaleman
Copy link
Member Author

alvaroaleman commented Oct 30, 2025

@alvaroaleman Can we backport this up to 0.20? And maybe ask for a 20.z release? Thank you!
Our k8s dependencies are still old :)

This patch doesn't cleanly apply there and there are a number of fixes that are not in that version like for example #3338 or #3340. What keeps you from upgrading your k8s deps version?

@sbueringer
Copy link
Member

/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 Oct 30, 2025
@k8s-ci-robot
Copy link
Contributor

LGTM label has been added.

Git tree hash: 08c76a1c0d5433a9544fbfabf27b5352f4405d0e

@k8s-ci-robot
Copy link
Contributor

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: alvaroaleman, sbueringer

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:
  • OWNERS [alvaroaleman,sbueringer]

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@sbueringer
Copy link
Member

I'm also hesitant to backport it that far at this point. You might be able to copy the current PQ implementation, create a PQ instance yourself and then pass it into the manager.

@k8s-ci-robot k8s-ci-robot merged commit 64152a0 into kubernetes-sigs:release-0.22 Oct 30, 2025
7 checks passed
@fossedihelm
Copy link
Contributor

@alvaroaleman Can we backport this up to 0.20? And maybe ask for a 20.z release? Thank you!
Our k8s dependencies are still old :)

This patch doesn't cleanly apply there and there are there fixes that are not in that version like for example #3338 or #3340. What keeps you from upgrading your k8s deps version?

@alvaroaleman Actually is a mix or k8s dependencies / minimum go version and stable branches.
Our release-1.6 is using go 1.23.
Of course, I can provide the manual cherry pick for both 0.21/0.20.
Thanks in advance

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. lgtm "Looks good to me", indicates that a PR is ready to be merged. 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.

4 participants