Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

没有可用服务时,客户端线程会hang住 #42

Closed
stan9333 opened this issue Apr 18, 2023 · 0 comments · Fixed by #43
Closed

没有可用服务时,客户端线程会hang住 #42

stan9333 opened this issue Apr 18, 2023 · 0 comments · Fixed by #43
Labels
bug Something isn't working

Comments

@stan9333
Copy link
Contributor

Describe the bug
服务端无可用服务,或服务端的地址配置错误时。
客户端的请求会hang住,且没有任何报错信息。

To Reproduce
在quickstart-example项目中只启动客户端进行访问即可

Expected behavior
抛出异常即可

Environment

  • Version: master分支
  • OS: MacOS Big Sur 11.4

Additional context
原生的ManagedChannelBuilder的表现是正常的,即抛出如下异常
13:20:20.760 [pool-2-thread-1] ERROR com.tencent.polaris.grpc.ConsumerHttpHandler - ConsumerHttpHandler error io.grpc.StatusRuntimeException: UNAVAILABLE: io exception at io.grpc.stub.ClientCalls.toStatusRuntimeException(ClientCalls.java:262) at io.grpc.stub.ClientCalls.getUnchecked(ClientCalls.java:243) at io.grpc.stub.ClientCalls.blockingUnaryCall(ClientCalls.java:156) at com.tencent.polaris.grpc.HelloGrpc$HelloBlockingStub.sayHello(HelloGrpc.java:157) at com.tencent.polaris.grpc.HelloConsumer.hello(HelloConsumer.java:60) at com.tencent.polaris.grpc.ConsumerHttpHandler.handle(ConsumerServer.java:66) at com.sun.net.httpserver.Filter$Chain.doFilter(Filter.java:79) at sun.net.httpserver.AuthFilter.doFilter(AuthFilter.java:83) at com.sun.net.httpserver.Filter$Chain.doFilter(Filter.java:82) at sun.net.httpserver.ServerImpl$Exchange$LinkHandler.handle(ServerImpl.java:705) at com.sun.net.httpserver.Filter$Chain.doFilter(Filter.java:79) at sun.net.httpserver.ServerImpl$Exchange.run(ServerImpl.java:677) at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149) at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624) at java.lang.Thread.run(Thread.java:750) Caused by: io.grpc.netty.shaded.io.netty.channel.AbstractChannel$AnnotatedConnectException: Connection refused: /127.0.0.1:2222 Caused by: java.net.ConnectException: Connection refused at sun.nio.ch.SocketChannelImpl.checkConnect(Native Method) at sun.nio.ch.SocketChannelImpl.finishConnect(SocketChannelImpl.java:716) 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:707) at io.grpc.netty.shaded.io.netty.channel.nio.NioEventLoop.processSelectedKeysOptimized(NioEventLoop.java:655) at io.grpc.netty.shaded.io.netty.channel.nio.NioEventLoop.processSelectedKeys(NioEventLoop.java:581) 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(Thread.java:750) s

@stan9333 stan9333 added the bug Something isn't working label Apr 18, 2023
stan9333 pushed a commit to stan9333/grpc-java-polaris that referenced this issue Apr 19, 2023
SkyeBeFreeman pushed a commit that referenced this issue Apr 19, 2023
Co-authored-by: zhaojian15 <zhaojian15@baidu.com>
# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant