gRPC-haskell icon indicating copy to clipboard operation
gRPC-haskell copied to clipboard

Support streaming call cancellation

Open Gabriella439 opened this issue 7 years ago • 2 comments

My understanding is that the current library does not yet support streaming call cancellation so we should add support for that

Gabriella439 avatar Mar 06 '17 22:03 Gabriella439

To clarify this, in my tests previously, calling grpc_call_cancel on the server side after a streaming call has started doesn't have any effect. I wasn't able to find any place in the flow where inserting grpc_call_cancel had any effect on the RPC. This might have been fixed in more recent versions of gRPC (the C core has seen a lot of bug fixes that I haven't entirely kept up with), but we need to investigate further.

crclark avatar May 02 '17 14:05 crclark

I was able to get server streaming call cancellation to work a while ago, but it definitely has some rough edges, and I have some work in a branch I need to revisit. The rough edges were mostly things like status details being logged in GRPC debug spam but not actually propagating back to the client, and some awkward typing of our lower level wrapper around serverCallCancel (ie., it's a usage wart cancel the call and then still need to return response data that never propagates to the RPC caller).

We may need to do some light experimentation with the underlying C behavior for calls and make sure we understand how it's all supposed to behave. My experience has been that call cancellation occurs but that the messaging around the event is somewhat strange.

Also need to write some cancellation tests for all of the streaming modes and determine what does/doesn't work currently. I decided that the server streaming call cancellation as it is supported after we moved to grpc-core 1.x seems to be barely working: the call is cancelled, and there is an error message, but the error message might be confusing and things like status details certainly don't seem to propagate.

I'll assign this issue to myself as well (feel free to take it if you are so inclined, though!), and I'll try to get the partial work I have into a branch so that y'all can take a peek.

intractable avatar May 02 '17 19:05 intractable