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

Fix #119 - CloseNotify race with ServeHTTP #120

Merged
merged 1 commit into from
Mar 3, 2016

Conversation

cuongdo
Copy link

@cuongdo cuongdo commented Mar 2, 2016

The generated code for the mux handlers can panic if the call to
ServeHTTP() finishes before the goroutine finishes. This is because
CloseNotify() can only be called before ServeHTTP() finishes. I've
fixed this by calling CloseNotify() before starting the goroutine. The
returned channel can safely be selected any time after that.

Review on Reviewable

The generated code for the mux handlers can panic if the call to
ServeHTTP() finishes before the goroutine finishes. This is because
CloseNotify() can only be called before ServeHTTP() finishes. I've
fixed this by calling CloseNotify() before starting the goroutine. The
returned channel can safely be selected any time after that.
@yugui
Copy link
Member

yugui commented Mar 3, 2016

LGTM

yugui added a commit that referenced this pull request Mar 3, 2016
Fix #119 - CloseNotify race with ServeHTTP
@yugui yugui merged commit 820a8f4 into grpc-ecosystem:master Mar 3, 2016
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.

2 participants