-
Notifications
You must be signed in to change notification settings - Fork 1.2k
🐛 Priorityqueue: Don't block on Get when queue is shutdown #3243
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
🐛 Priorityqueue: Don't block on Get when queue is shutdown #3243
Conversation
Hi @dongjiang1989. 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 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. |
36826fd
to
3ac1786
Compare
/ok-to-test |
@@ -277,6 +277,13 @@ func (w *priorityqueue[T]) GetWithPriority() (_ T, priority int, shutdown bool) | |||
w.waiters.Add(1) | |||
|
|||
w.notifyItemOrWaiterAdded() | |||
|
|||
// ref: https://github.com/kubernetes-sigs/controller-runtime/issues/3239 | |||
if w.shutdown.Load() == true { |
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.
No need to compare booleans:
if w.shutdown.Load() == true { | |
if w.shutdown.Load() { |
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 @alvaroaleman
Fixed
Please re-check it
Signed-off-by: dongjiang <[email protected]>
ca470ca
to
342e14d
Compare
/test pull-controller-runtime-test |
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!
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: alvaroaleman, dongjiang1989 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 |
LGTM label has been added. Git tree hash: 814d59ddf9c39680dfc31eac2d99f146aaf31d6f
|
/cherrypick release-v0.21 |
@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: cannot checkout 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. |
/cherrypick release-0.21 |
@alvaroaleman: new pull request created: #3245 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. |
Close #3239
Fix priority queue
GetWithPriority
blocking when the priority queue is shut down