gRPC occasionally appears abnormal

1,669 views
Skip to first unread message

李灵韬

unread,
Jun 14, 2021, 10:45:28 PM6/14/21
to grpc.io
I recently added grpc to my app, but it occasionally reports errors, which cannot be reproduced stably.
Console output:
java.util.concurrent.ExecutionException: io.grpc.StatusRuntimeException: UNAVAILABLE: io exception
at com.google.common.util.concurrent.AbstractFuture.getDoneValue(AbstractFuture.java:566)
at com.google.common.util.concurrent.AbstractFuture.get(AbstractFuture.java:547)

My client uses Java, the server uses Python, and the grpc version is 1.36.0

李灵韬

unread,
Jun 14, 2021, 10:49:23 PM6/14/21
to grpc.io
Do I need to provide more information?

李灵韬

unread,
Jun 14, 2021, 11:34:46 PM6/14/21
to grpc.io
Caused by: io.grpc.netty.shaded.io.netty.channel.AbstractChannel$AnnotatedConnectException: Connection refused: no further information: /127.0.0.1:50051
Caused by: java.net.ConnectException: Connection refused: no further information
at sun.nio.ch.SocketChannelImpl.checkConnect(Native Method)
at sun.nio.ch.SocketChannelImpl.finishConnect(Unknown Source)
at io.grpc.netty.shaded.io.netty.channel.socket.nio.NioSocketChannel.doFinishConnect(NioSocketChannel.java:330)
at io.grpc.netty.shaded.io.netty.channel.nio.AbstractNioChannel$AbstractNioUnsafe.finishConnect(AbstractNioChannel.java:334)
at io.grpc.netty.shaded.io.netty.channel.nio.NioEventLoop.processSelectedKey(NioEventLoop.java:702)
at io.grpc.netty.shaded.io.netty.channel.nio.NioEventLoop.processSelectedKeysOptimized(NioEventLoop.java:650)
at io.grpc.netty.shaded.io.netty.channel.nio.NioEventLoop.processSelectedKeys(NioEventLoop.java:576)
at io.grpc.netty.shaded.io.netty.channel.nio.NioEventLoop.run(NioEventLoop.java:493)
at io.grpc.netty.shaded.io.netty.util.concurrent.SingleThreadEventExecutor$4.run(SingleThreadEventExecutor.java:989)
at io.grpc.netty.shaded.io.netty.util.internal.ThreadExecutorMap$2.run(ThreadExecutorMap.java:74)
at io.grpc.netty.shaded.io.netty.util.concurrent.FastThreadLocalRunnable.run(FastThreadLocalRunnable.java:30)
at java.lang.Thread.run(Unknown Source)
Message has been deleted
Message has been deleted

Lidi Zheng

unread,
Jun 15, 2021, 1:38:09 PM6/15/21
to 李灵韬, grpc.io
Hi,

UNAVAILABLE is one of the gRPC status codes, like 503 in HTTP status code. You can read more about the gRPC status code at https://github.com/grpc/grpc/blob/master/doc/statuscodes.md.

What you are experiencing could have many different causes. I would recommend tuning up the Java client's log verbosity to see what exactly is failing the connection.

Lidi Zheng



On Mon, Jun 14, 2021 at 11:56 PM 李灵韬 <lilts...@gmail.com> wrote:

I changed my code 
ManagedChannelBuilder.forAddress("localhost", port).usePlaintext().build(); 
to 
ManagedChannelBuilder.forAddress("localhost", port).forAddress("127.0.0.1", port).usePlaintext().build();
, this seems to succeed, no errors occurred, very strange
--
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+u...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/grpc-io/bb149700-1af6-46fd-a5cc-37294b478e5bn%40googlegroups.com.
Reply all
Reply to author
Forward
0 new messages