🐛 priority queue: properly sync the waiter manipulation#3368
Conversation
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 <ffossemo@redhat.com>
|
|
|
Welcome @fossedihelm! |
|
Hi @fossedihelm. 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 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. |
|
/cc |
|
@vladikr: GitHub didn't allow me to request PR reviews from the following users: vladikr. Note that only kubernetes-sigs members and repo collaborators can review this PR, and authors cannot review their own PRs. DetailsIn response to this:
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. |
|
/ok-to-test Please sign the CLA so we can accept your contribution |
|
@alvaroaleman Signed :) Thanks |
|
/cherrypick release-0.22 |
|
@alvaroaleman: once the present PR merges, I will cherry-pick it on top of DetailsIn response to this:
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. |
|
LGTM label has been added. DetailsGit tree hash: 5508fa28ebb9007be1ae0bf5797fd80ec2fb2dc1 |
|
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: alvaroaleman, fossedihelm 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 |
|
@alvaroaleman: #3368 failed to apply on top of branch "release-0.22": DetailsIn response to this:
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. |
|
Thx! /lgtm |
As described in #3363, there are some circumstances under which
GetWithPrioritydoes not return the correct/expected element.This can happen when a
GetWithPriorityis executed and theAscendof the queue is not completed yet, causing not all the items of the BTree to evaluate the samew.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.
Fixes: #3363