-
Notifications
You must be signed in to change notification settings - Fork 4.4k
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
Context cancelation does not propagate from the client to the server for streams #188
Comments
looking.. On Fri, May 8, 2015 at 7:45 AM, Russ Amos [email protected] wrote:
|
ok, the right pattern to cancel a stream in your use case is as follows:
This design is intended because other alternatives either increases a fair Let me know if your issue gets addressed by this. Thank you for reporting. On Fri, May 8, 2015 at 10:07 AM, Qi Zhao [email protected] wrote:
|
fixed by #189 |
Closes grpc#188 Revert change discussed in grpc/grpc.io#186 (comment)
I have a stream defined that will send messages perpetually to the client, until the client is no longer interested. Since there is no "stream.Close" on the client side (only stream.CloseSend), I assume using context.WithCancel on the client side is the correct way to do this. However, it seems like cancelation is not being propagated to the server: The server continues calling Send (with no errors) long after the client stops caring, and eventually the Send blocks entirely and the server's goroutine hangs. I think the goroutines are unblocked and exit if the connection is closed, but I didn't test that thoroughly.
Unary RPCs seem to honor context cancelation.
Is there some other way for the client to indicate it is no longer interested in the stream?
The text was updated successfully, but these errors were encountered: