Skip to content

fixed Queue.Poll() timout bug, Put() would get stuck on leftover sema #114

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

Merged
merged 1 commit into from
Sep 29, 2015

Conversation

ghost
Copy link

@ghost ghost commented Sep 29, 2015

If you call Poll() and it times out and returns, then a future call to Put() would hang forever, due to a sema that was left behind.

@@ -85,6 +85,9 @@ func TestGet(t *testing.T) {
func TestPoll(t *testing.T) {
q := New(10)

// should be able to Poll() before anything is present, without breaking future Puts
q.Poll(1, time.Millisecond)

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

without the Poll() code change in place, the next Put() would hang indefinitely

@alexandercampbell-wk
Copy link
Contributor

@dustinhiatt-wf
Copy link
Contributor

+1

dustinhiatt-wf added a commit that referenced this pull request Sep 29, 2015
fixed Queue.Poll() timout bug, Put() would get stuck on leftover sema
@dustinhiatt-wf dustinhiatt-wf merged commit 78bcce4 into Workiva:master Sep 29, 2015
@tylertreat-wf
Copy link
Contributor

Thanks!

@teresarevious-wf
Copy link

@Rosie run_merge_script

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants