How does gRPC client-streaming flow control work in go?

kfertakis :

I would like to know, how flow control works in a client-streaming gRPC service in Go.

Specifically, I am interested in knowing when will a call to stream.SendMsg() function in the client-side block? According to the documentation :

SendMsg() blocks until :

  • There is sufficient flow control to schedule m with the transport, or ...

So what is the specification for the flow control mechanism of the stream? For example, if the server-side code responsible for reading the messages from the stream, isn't reading the messages fast enough, at what point will calls to SendMsg() block?

Is there some kind of backpressure mechanism implemented for the server to tell the client that it is not ready to receive more data? In the meantime, where are all the messages that have been successfully sent before the backpressure signal, queued?

menghanl :

gRPC flow control is based on http2 flow control: https://http2.github.io/http2-spec/#FlowControl

There will be backpressure. Messages are only successfully sent when there's enough flow control window for them, otherwise SendMsg() will block.

The signal from the receiving side is not to add backpressure, it's to release backpressure. It's like saying "now I'm ready to receive another 1MB of messages, send them".

Collected from the Internet

Please contact [email protected] to delete if infringement.

edited at
0

Comments

0 comments
Login to comment

Related

How does GO TO control flow work in COBOL?

gRPC client in C# does not work with gRPC server in Go with mTLS support

How does the control flow for break statements work in nested loops? (Java)

How to keep an Android grpc client with server streaming connection alive?

GRPC: Client streaming with configuration message

How does the program control flow in generator?

gRPC: How to get multiple return values in Java client with Go server

How to assert gRPC error codes client side in Go

How to confirm gRPC traffic from Go client is TLS encrypted

how to implement non-blocking client in grpc go?

gRPC, Go & Cloud Run - How to elegantly handle client authorisation?

My gRPC client in a docker container doesn't work but the client outside the container go well

How does streaming operator unpacking work?

Grpc python client server streaming not working as expected

Modifying metadata on Go GRPC server streaming interceptor

Go Benchmark how does it work

How does .(type) work in go

How can a gRPC server notice that the client has cancelled a server-side streaming call?

How to upload an image in chunks with client-side streaming gRPC using grpcurl

How does grpc-web security work in production?

How GO To flow behaves/work, if PARA has only EXIT statement

How does control flow in Java8 collectors?

EchoBot: How does control flow from BotController to EchoBot

How to control the flow of a CompletableFuture?

Interface Python Thrift client with Go gRPC server

How Does Ivy Work With Version Control Tags

How does version control with LabVIEW VIs work?

How does Control.Enabled work?

How does version control work for actions on google?