forked from grpc/grpc-web
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Prevent leaking goroutines from websocket connections (grpc#253)
The write to the CloseNotify() channel was blocking, preventing the Read() call from exiting, and preventing ServeHTTP from returning. This meant that requests tended to stay around forever in a deadlocked state. Using the context package prevent this, as the cancellation is non-blocking. It depends on Go 1.7. Note that the writer still needs to support the CloseNotifier interface, otherwise other things break, but it does not seem to be necessary to signal using it.
- Loading branch information
1 parent
b89ec63
commit 1464bd9
Showing
2 changed files
with
11 additions
and
4 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters