Scott Devoid
unread,Jun 6, 2016, 5:59:23 PM6/6/16Sign in to reply to author
Sign in to forward
You do not have permission to delete messages in this group
Either email addresses are anonymous for this group or you need the view member email addresses permission to view the original message
to grp...@googlegroups.com
Hi,
I have a few questions about how gRPC cancellation works in Golang:
First, what are the conditions under which a request could be
cancelled? I can think of a two but let me know if I am missing some
or incorrect:
- client cancels context.Context passed into request.
- TCP socket closes after a timeout?
- HTTP/2 client/server sends RST_STREAM for...reasons?
Second, if the client cancels the context, is the server notified
about this (assuming no loss of connectivity)? Can I select on
req.Context().Done() and perform some clean-up work after the fact or
does the request handler immediately return?
Third, in one of our bidirectional gRPC methods[1] we see a 'stream
error: code = 1 desc = "context cancelled"' event. However the client
passed in a context.Background() to the request so as far as I can
tell this cancellation has to be happening in grpc internals some
place. Does anyone know what is going on here?
Thanks!
~ Scott Devoid
[1] rpc Foo(stream Req) returns (stream Resp) {}