-
Notifications
You must be signed in to change notification settings - Fork 1.2k
🐛 priority queue: properly sync the waiter manipulation
#3368
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
🐛 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 <[email protected]>
|
|
|
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. 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. |
|
/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. In 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 In 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. |
alvaroaleman
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
thanks!
|
LGTM label has been added. Git 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
Needs 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": In 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