microsoft / CCF

Confidential Consortium Framework
https://microsoft.github.io/CCF/
Apache License 2.0
770 stars 208 forks source link

Support for gRPC client streaming #4683

Open jumaffre opened 1 year ago

jumaffre commented 1 year ago

Same as https://github.com/microsoft/CCF/issues/4325, but the other way around.

The tricky part is that we cannot yield (i.e. it's blocking!) from the endpoint handler until more messages from the client are available for reading, although we should be able to provide the same programming model as for the C++ gRPC library (see https://grpc.io/docs/languages/cpp/basics/#streaming-rpcs).

jumaffre commented 1 year ago

As discussed with @eddyashton, this is a significant chunk of work that doesn't seem absolutely necessary for external executor support right now, so probably not as urgent for 4.x as other items. This is significant because there's no way to identify early (i.e. HTTP/2 layer) whether an endpoint will support client streaming, and so the frontend logic needs to be changed for all request types (e.g. unary and streaming).

In particular:

The investigation work is on this branch and currently supports a single client-streaming endpoint.

jumaffre commented 1 year ago

As discussed, in the meantime, we should write documentation to explain the behaviour if a client starts streaming requests to the server. The stream will currently hang as the NGHTTP2_FLAG_END_STREAM isn't sent by the client.

jumaffre commented 1 year ago

This work will be necessary to support gRPC apps, e.g. https://github.com/microsoft/LSKV.

jumaffre commented 10 months ago

See ccf_watches.path in https://github.com/microsoft/LSKV/pull/186 for a small patch to support this.