Skip to content
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

use a buffered channel in the acceptQueue #53

Merged
merged 1 commit into from
Dec 8, 2022

Conversation

marten-seemann
Copy link
Member

There's a race condition here. A user might call Next to obtain the next stream, and get a nil result. He then calls Chan get notified about new incoming streams. If a new stream is accepted between the call to Next and the call to Chan, he won't be notified about that stream, unless the channel is buffered.

There's a race condition here. A user might call Next to obtain the next
stream, and get a nil result. He then calls Chan get notified about new
incoming streams. If a new stream is accepted between the call to Next and the
call to Chan, he won't be notified about that stream, unless the channel is
buffered.
@BigLep
Copy link

BigLep commented Dec 12, 2022

@marten-seemann ; Is there a way to add a regression test for this?

@marten-seemann
Copy link
Member Author

A few of the tests here were flaky before this fix. As this is a race condition, this is probably all we can ask for. And again shows the value of debugging flaky tests.

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.

3 participants