Dubbo错误排查

这篇博客分析了一次Dubbo服务调用中出现的客户端超时和服务器端通道关闭的问题。客户端报错显示请求方法超时,而服务端警告显示无法向客户端发送响应,原因是通道被关闭。解决办法是检查并配置客户端超时时间,确保其设置合理。
摘要由CSDN通过智能技术生成

客户端错误:

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

cause: Waiting server-side response timeout by scan timer. start time: 2015-06-17 14:46:49.979, end time: 2015-06-17 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-172.25.6.248:20882-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 W o r k e r . r u n T a s k ( T h r e a d P o o l E x e c u t o r . j a v a : 886 ) a t j a v a . u t i l . c o n c u r r e n t . T h r e a d P o o l E x e c u t o r Worker.runTask(ThreadPoolExecutor.java:886) at java.util.concurrent.ThreadPoolExecutor Worker.runTask(ThreadPoolExecutor.java:886)atjava.util.concurrent.ThreadPoolExecutorWorker.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
原因分析

客户端日志可以看到是超时错误。

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

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

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

是超时的配置

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

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值