-
Notifications
You must be signed in to change notification settings - Fork 40k
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
MESOS: fix race condition in contrib/mesos/pkg/queue/delay #24916
MESOS: fix race condition in contrib/mesos/pkg/queue/delay #24916
Conversation
@@ -164,6 +188,7 @@ func (q *DelayQueue) pop(next func() *qitem, cancel <-chan struct{}) interface{} | |||
select { | |||
case <-cancel: | |||
item.readd(item) | |||
sitAndSpin(&q.cond, ch) |
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.
prevents an (unlikely) goroutine leak (any future broadcast received by the Wait would cause the above goroutine to exit)
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.
Would a q.cond.Broadcast
instead do any harm here?
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.
it's simpler and (in real life usage) probably all that is needed. because we're not creating these queues and throwing them away in the real world, we use them indefinitely. however it's less correct so I think I prefer this version.
renamed the new func I added to something more appropriate |
@@ -138,6 +139,29 @@ func (q *DelayQueue) Pop() interface{} { | |||
}, nil) | |||
} | |||
|
|||
func finishWaiting(cond *sync.Cond, waitFinished <-chan struct{}) { |
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.
this is pretty ugly. But I don't know a better solution right now.
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.
agree. I'd really like to have something cleaner, but this should stop the
bleeding.
On Fri, Apr 29, 2016 at 8:46 AM, Dr. Stefan Schimanski <
notifications@github.com> wrote:
In contrib/mesos/pkg/queue/delay.go
#24916 (comment)
:@@ -138,6 +139,29 @@ func (q *DelayQueue) Pop() interface{} {
}, nil)
}+func finishWaiting(cond *sync.Cond, waitFinished <-chan struct{}) {
this is pretty ugly. But I don't know a better solution right now.
—
You are receiving this because you authored the thread.
Reply to this email directly or view it on GitHub
https://github.com/kubernetes/kubernetes/pull/24916/files/a74573277f81565b3aeff8c5d4bfe2a3110c1ccd#r61570968
cc @k8s-oncall This is fixing a flaky test. |
Unrelated test failure:
On Tue, May 3, 2016 at 8:41 PM, Kubernetes Bot notifications@github.com
|
1 similar comment
@k8s-bot node e2e test this issue: #IGNORE |
@k8s-bot node e2e test this issue: #IGNORE |
@k8s-bot e2e test this issue: #IGNORE |
omg the tests finally passed. quick, merge queue, quick! |
GCE e2e build/test passed for commit a745732. |
@k8s-bot test this [submit-queue is verifying that this PR is safe to merge] |
GCE e2e build/test passed for commit a745732. |
Automatic merge from submit-queue |
attempt to fix #23822
/cc @ihmccreery