[java] Grpc Client concurrent requests go missing

445 views
Skip to first unread message

Ankur Chauhan

unread,
Mar 7, 2016, 10:58:52 PM3/7/16
to grpc.io

Hi,

I am integrating my gRPC service with another system that intends to send multiple requests to the gRPC server. I expect to send multiple request concurrently to the backend server. I created a single client instance (blocking stub) and was attempting to share this single request amongst all requests that get send to the server. But it seems like some of the requests get "lost" :-| As per logging, 20 requests get started at the client but the server only gets (as per logging) 16 requests. The behavior is pretty consistent.

Can the client be shared amongst requests? Am I missing something about the way the client is to be used or maybe a configuration parameter that I missed?

Ankur Chauhan

unread,
Mar 7, 2016, 11:25:07 PM3/7/16
to grpc.io
Adding more context:

I turned off parallel request behavior of the client an everything seems to work fine. I am using the grpc client inside a grails web application and executing multiple requests in parallel with a gpars in a forkJoinPool.

-- AC

Eric Anderson

unread,
Mar 9, 2016, 2:07:14 PM3/9/16
to Ankur Chauhan, grpc.io
Since you mentioned Grails, I'll assume you are using grpc-java. v0.13.0 had a bug which could lose RPCs, which was fixed in v0.13.1. Does it sound like you could be running into that problem?

In grpc-java, it is safe to use the same stub and channel multiple times, even across threads.

--
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.
To view this discussion on the web visit https://groups.google.com/d/msgid/grpc-io/a1f531e0-0629-40e2-926d-b883d0ed1343%40googlegroups.com.

For more options, visit https://groups.google.com/d/optout.

Ankur Chauhan

unread,
Mar 9, 2016, 2:15:11 PM3/9/16
to Eric Anderson, grpc.io
Thanks Eric, that was it. I updated it and all was better.
— Ankur Chauhan
Reply all
Reply to author
Forward
0 new messages