With gRPC can I have multiple RPC calls in progress over a single connection?

1.1k Views Asked by At

I'm having trouble getting multiple RPC calls to operate over a single connection. Server and client are both operating asynchronously using a completion queue.

I fire off a streaming call (getData), which sends one reply per second for 10 seconds. I wait a couple of seconds, then try to fire off a getVersion call (a unary call) and it doesn't come back until the getData call completes. Examination of the server shows that the getVersion call never hit the server until getData finished up.

And if I try to start multiple calls while the first getData is running, they all run once the first getData finishes. And in fact, they all run in parallel - for instance, if I fire off multiple getData calls, I can see all of them running in parallel after the first (blocking) getData finishes.

It's like you can queue up all you want, but once something is in progress you can't get a new call started on that channel?

Is this supposed to do this? It doesn't seem like the correct behavior, but my experience with gRPC is somewhat limited.

1

There are 1 best solutions below

0
On

The problem was a bug in the way I was waiting for the next time to send data. I was blocking things that I shouldn't have been.