StatusRuntimeException with gRPC stream: Channel closed

208 views
Skip to first unread message

mur...@akruta.com

unread,
Feb 12, 2019, 11:01:44 PM2/12/19
to grpc.io
Hi all,

I am trying to use multiple grpc bidirectional streams in the same service between a client and server. And every now and then I get the following error:
```
 io.grpc.StatusRuntimeException: CANCELLED: cancelled before receiving half close
        at io.grpc.Status.asRuntimeException(Status.java:517)
        at io.grpc.stub.ServerCalls$StreamingServerCallHandler$StreamingServerCallListener.onCancel(ServerCalls.java:272)
        at io.grpc.PartialForwardingServerCallListener.onCancel(PartialForwardingServerCallListener.java:40)
        at io.grpc.ForwardingServerCallListener.onCancel(ForwardingServerCallListener.java:23)
        at io.grpc.ForwardingServerCallListener$SimpleForwardingServerCallListener.onCancel(ForwardingServerCallListener.java:40)
        at io.grpc.Contexts$ContextualizedServerCallListener.onCancel(Contexts.java:96)
        at io.grpc.internal.ServerCallImpl$ServerStreamListenerImpl.closed(ServerCallImpl.java:293)
        at io.grpc.internal.ServerImpl$JumpToApplicationThreadServerStreamListener$1Closed.runInContext(ServerImpl.java:738)
        at io.grpc.internal.ContextRunnable.run(ContextRunnable.java:37)
        at io.grpc.internal.SerializingExecutor.run(SerializingExecutor.java:123)
        at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1162)
        at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:636)
        at java.lang.Thread.run(Thread.java:764)
```
did anyone else face this issue?
any pointers would be really appreciated.

Thanks,
Murali

mur...@akruta.com

unread,
Feb 12, 2019, 11:24:27 PM2/12/19
to grpc.io
This error occurs on the server side.
Also, what is the default timelimit for an rpc call?

Carl Mastrangelo

unread,
Feb 13, 2019, 11:34:53 AM2/13/19
to grpc.io
Cancellation is usually done by your application code, unless there is a proxy in the path.  There is no default time limit, and RPCs will never time out normally.   You can add one by setting a deadline on the stub.    Deadlines will fail with a DEADLINE_EXCEEDED error code, rather than a CANCELED.
Reply all
Reply to author
Forward
0 new messages