首页 > 编程语言 >dubbo java.nio.channels.ClosedChannelException、com.alibaba.dubbo.remoting.RemotingException: Failed

dubbo java.nio.channels.ClosedChannelException、com.alibaba.dubbo.remoting.RemotingException: Failed

时间:2022-11-01 11:32:19浏览次数:56  
标签:dubbo remoting java netty alibaba com


客户端错误:

com.alibaba.dubbo.rpc.RpcException: Invoke remote method timeout. method: searchUser, provider: 
...

cause: Waiting server-side response timeout by scan timer. start time: 2018-08-11 14:46:49.979, end time: 2018-08-11 14:46:51.002, client elapsed: 44 ms, server elapsed: 959 ms, timeout: 1000 ms, request: Request

...

服务端警告:

2015-06-17 14:46:52,454 WARN  [DubboServerHandler-192.168.25.129:2181-thread-2] (ChannelEventRunnable.java:84) -  [DUBBO] ChannelEventRunnable handle RECEIVED operation error
com.alibaba.dubbo.remoting.RemotingException: Failed to send message Response [id=0, version=2.0.0, status=20, event=false, error=null, result=RpcResult [result=com.ceair.cesso.dto.SearchUserResult@7ba2a1d2, exception=null]] to /172.25.3.91:50849, cause: null
at com.alibaba.dubbo.remoting.transport.netty.NettyChannel.send(NettyChannel.java:108)
at com.alibaba.dubbo.remoting.transport.AbstractPeer.send(AbstractPeer.java:51)
at com.alibaba.dubbo.remoting.exchange.support.header.HeaderExchangeHandler.received(HeaderExchangeHandler.java:171)
at com.alibaba.dubbo.remoting.transport.DecodeHandler.received(DecodeHandler.java:52)
at com.alibaba.dubbo.remoting.transport.dispatcher.ChannelEventRunnable.run(ChannelEventRunnable.java:82)
at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:886)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:908)
at java.lang.Thread.run(Thread.java:662)
Caused by: java.nio.channels.ClosedChannelException
at org.jboss.netty.channel.socket.nio.NioWorker.cleanUpWriteBuffer(NioWorker.java:643)
at org.jboss.netty.channel.socket.nio.NioWorker.writeFromUserCode(NioWorker.java:370)
at org.jboss.netty.channel.socket.nio.NioServerSocketPipelineSink.handleAcceptedSocket(NioServerSocketPipelineSink.java:137)
at org.jboss.netty.channel.socket.nio.NioServerSocketPipelineSink.eventSunk(NioServerSocketPipelineSink.java:76)
at org.jboss.netty.channel.Channels.write(Channels.java:632)
at org.jboss.netty.handler.codec.oneone.OneToOneEncoder.handleDownstream(OneToOneEncoder.java:70)
at com.alibaba.dubbo.remoting.transport.netty.NettyHandler.writeRequested(NettyHandler.java:99)
at org.jboss.netty.channel.Channels.write(Channels.java:611)
at org.jboss.netty.channel.Channels.write(Channels.java:578)
at org.jboss.netty.channel.AbstractChannel.write(AbstractChannel.java:251)
at com.alibaba.dubbo.remoting.transport.netty.NettyChannel.send(NettyChannel.java:98)
... 7 more

原因分析

客户端日志可以看到是超时错误。(正在进行调试)

接着给出信息:客户端、服务端花费的时间;

在看服务端,是通道被关闭,无法发送信息。

整体看起来,就是超时了,客户端没有得到返回信息,服务端不能发送信息。

检查客户端、服务端的超时配置;发现客户端的超时时间没有设置,设置为一个较长时间,就可以了。

<!-- 超时单位为毫秒 -->
<dubbo:reference interface="cn.e3mall.content.service.ContentService" id="contentService" timeout="1200000"></dubbo:reference>

标签:dubbo,remoting,java,netty,alibaba,com
From: https://blog.51cto.com/u_13351110/5812938

相关文章