Behaviour of CallStreamObserver.isReady [grpc-java]

61 views
Skip to first unread message

Petra Bierleutgeb

unread,
Jun 11, 2017, 8:30:25 AM6/11/17
to grpc.io
It seems that on the client side CallStreamObserver.isReady and ClientCall.isReady is always true even if I disableAutoInboundFlowControl on the server side and don't request new messages.

Here's basically what I do:

1) server side: call disableAutoInboundFlowControl on the responseObserver received as parameter
2) client side: check isReady on the requestObserver returned by the call

I also tried using the more low-level ClientCall class but with the same outcome.

Is that the intended behaviour and if so, how can I check whether the remote peer has requested more messages?

Thanks
Petra

Eric Anderson

unread,
Jun 20, 2017, 1:57:33 PM6/20/17
to Petra Bierleutgeb, grpc.io
Is your RPC a client-streaming or bidirectional RPC? If not, you're not going to see much benefit from isReady on client-side.

isReady() will become true before the server actually sees the RPC. There is buffering done in gRPC to allow for adequate throughput, so the isReady() is not precisely 1:1 between request() on server-side. There is a hard-coded buffer of 64 KB and the default window size is 1 MB, so if you are sending less than 1 MB, isReady() won't limit you much. (You can change the window size though on the channel builder.) In the future we'd like to auto-tune the window to be able to push-back earlier.

If that doesn't explain the behavior you're seeing, then it'd be good to know more about the streams you're dealing with.

--
You received this message because you are subscribed to the Google Groups "grpc.io" group.
To unsubscribe from this group and stop receiving emails from it, send an email to grpc-io+unsubscribe@googlegroups.com.
To post to this group, send email to grp...@googlegroups.com.
Visit this group at https://groups.google.com/group/grpc-io.
To view this discussion on the web visit https://groups.google.com/d/msgid/grpc-io/c37cfefe-6f4e-4eb7-9b22-48dfe112447d%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply all
Reply to author
Forward
0 new messages