If the connection is alive and the server doesn't send anything, the call will just wait. What does your server code look like?
On Monday, July 18, 2016 at 7:38:54 PM UTC-7, [email protected] wrote: > > I run into an issue that `BlockingResponseStream.hasNext` occasionally > blocks forever while sending response for a streaming RPC. > GRPC server is still able to serve requests after client hangs. No > exception is found in server log, and server does call > "responseObserver.onCompleted()" after each GRPC. > It only happens to me when streaming millions of messages. > I haven't found any reliable way to reproduce this issue, but following > code and comment in `ClientCalls.java` caught my attention: > > try { >> // Will block here indefinitely waiting for content. RPC timeouts >> defend against permanent >> // hangs here as the call will become closed. >> last = waitForNext(); >> } catch (InterruptedException ie) { >> Thread.currentThread().interrupt(); >> throw Status.CANCELLED.withCause(ie).asRuntimeException(); >> } > > > I am not vary familiar with GRPC codebase. Could someone tell me when is > this call going to block and which thread usually unblocks it? What could > cause the call being blocked forever? > It seems GRPC does not timeout by default. Should I specify RPC timeout? > What's the best practice for streaming millions of messages? > -- 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 [email protected]. To post to this group, send email to [email protected]. To view this discussion on the web visit https://groups.google.com/d/msgid/grpc-io/19ae8808-52ca-426a-be5f-d20a05f4a415%40googlegroups.com. For more options, visit https://groups.google.com/d/optout.
