什么情况会造成dubbo链接中断?

一个手动调用的dubbo服务,调用后,服务端正常执行完了。但是客户端没有接受到任何返回信息。
检查日志后
服务端:
2018-12-12 02:51:26 [org.I0Itec.zkclient.ZkClient]-[DEBUG] Received event: WatchedEvent state:Disconnected type:None path:null
2018-12-12 02:51:26 [org.I0Itec.zkclient.ZkEventThread]-[DEBUG] New event: ZkEvent[State changed to Disconnected sent to com.alibaba.dubbo.remoting.zookeeper.zkclient.ZkclientZookeeperClient$1@28ce7d23]
2018-12-12 02:51:26 [org.I0Itec.zkclient.ZkClient]-[DEBUG] Leaving process event
2018-12-12 02:51:26 [org.I0Itec.zkclient.ZkEventThread]-[DEBUG] Delivering event #1 ZkEvent[State changed to Disconnected sent to com.alibaba.dubbo.remoting.zookeeper.zkclient.ZkclientZookeeperClient$1@28ce7d23]
2018-12-12 02:51:26 [org.I0Itec.zkclient.ZkEventThread]-[DEBUG] Delivering event #1 done
2018-12-12 02:51:46 [org.I0Itec.zkclient.ZkClient]-[DEBUG] Received event: WatchedEvent state:Expired type:None path:null
2018-12-12 02:51:46 [org.I0Itec.zkclient.ZkEventThread]-[DEBUG] New event: ZkEvent[State changed to Expired sent to com.alibaba.dubbo.remoting.zookeeper.zkclient.ZkclientZookeeperClient$1@28ce7d23]
2018-12-12 02:51:46 [org.I0Itec.zkclient.ZkConnection]-[DEBUG] Closing ZooKeeper connected to 10.1.10.91:2181,10.1.10.92:2181,10.1.10.93:2181
2018-12-12 02:51:46 [org.I0Itec.zkclient.ZkEventThread]-[DEBUG] Delivering event #2 ZkEvent[State changed to Expired sent to com.alibaba.dubbo.remoting.zookeeper.zkclient.ZkclientZookeeperClient$1@28ce7d23]
2018-12-12 02:51:46 [org.I0Itec.zkclient.ZkEventThread]-[DEBUG] Delivering event #2 done
2018-12-12 02:51:46 [org.apache.zookeeper.ZooKeeper]-[DEBUG] Close called on already closed client

zk日志:
2018-12-12 02:51:46,630 [myid:1] - INFO [NIOServerCxn.Factory:0.0.0.0/0.0.0.0:2181:NIOServerCnxnFactory@192] - Accepted socket connection from /10.1.10.47:47124
2018-12-12 02:51:46,637 [myid:1] - WARN [NIOServerCxn.Factory:0.0.0.0/0.0.0.0:2181:ZooKeeperServer@896] - Connection request from old client /10.1.10.47:47124; will be dropped if server is in r-o mode
2018-12-12 02:51:46,638 [myid:1] - INFO [NIOServerCxn.Factory:0.0.0.0/0.0.0.0:2181:ZooKeeperServer@935] - Client attempting to renew session 0x365ee3f0f34002c at /10.1.10.47:47124
2018-12-12 02:51:46,638 [myid:1] - INFO [NIOServerCxn.Factory:0.0.0.0/0.0.0.0:2181:Learner@108] - Revalidating client: 0x365ee3f0f34002c
2018-12-12 02:51:46,639 [myid:1] - INFO [QuorumPeer[myid=1]/0:0:0:0:0:0:0:0:2181:ZooKeeperServer@680] - Invalid session 0x365ee3f0f34002c for client /10.1.10.47:47124, probably expired
2018-12-12 02:51:46,640 [myid:1] - INFO [NIOServerCxn.Factory:0.0.0.0/0.0.0.0:2181:NIOServerCnxn@1044] - Closed socket connection for client /10.1.10.47:47124 which had sessionid 0x365ee3f0f34002c
2018-12-12 02:52:23,235 [myid:1] - INFO [NIOServerCxn.Factory:0.0.0.0/0.0.0.0:2181:NIOServerCnxnFactory@192] - Accepted socket connection from /10.1.10.47:47284
2018-12-12 02:52:23,236 [myid:1] - WARN [NIOServerCxn.Factory:0.0.0.0/0.0.0.0:2181:ZooKeeperServer@896] - Connection request from old client /10.1.10.47:47284; will be dropped if server is in r-o mode
2018-12-12 02:52:23,238 [myid:1] - INFO [NIOServerCxn.Factory:0.0.0.0/0.0.0.0:2181:ZooKeeperServer@942] - Client attempting to establish new session at /10.1.10.47:47284
2018-12-12 02:52:23,244 [myid:1] - INFO [CommitProcessor:1:ZooKeeperServer@687] - Established session 0x165ee402a7d003d with negotiated timeout 30000 for client /10.1.10.47:47284


服务端的方法是一个多线程方法,执行期间没有任何报错,想请教大神们一下,什么情况下才会造成dubbo链接的中断?通常这种问题要怎么调整?


zkserver端日志
2018-12-12 02:51:46,630 [myid:1] - INFO [NIOServerCxn.Factory:0.0.0.0/0.0.0.0:2181:NIOServerCnxnFactory@192] - Accepted socket connection from /10.1.10.47:47124
2018-12-12 02:51:46,637 [myid:1] - WARN [NIOServerCxn.Factory:0.0.0.0/0.0.0.0:2181:ZooKeeperServer@896] - Connection request from old client /10.1.10.47:47124; will be dropped if server is in r-o mode
2018-12-12 02:51:46,638 [myid:1] - INFO [NIOServerCxn.Factory:0.0.0.0/0.0.0.0:2181:ZooKeeperServer@935] - Client attempting to renew session 0x365ee3f0f34002c at /10.1.10.47:47124
2018-12-12 02:51:46,638 [myid:1] - INFO [NIOServerCxn.Factory:0.0.0.0/0.0.0.0:2181:Learner@108] - Revalidating client: 0x365ee3f0f34002c
2018-12-12 02:51:46,639 [myid:1] - INFO [QuorumPeer[myid=1]/0:0:0:0:0:0:0:0:2181:ZooKeeperServer@680] - Invalid session 0x365ee3f0f34002c for client /10.1.10.47:47124, probably expired
2018-12-12 02:51:46,640 [myid:1] - INFO [NIOServerCxn.Factory:0.0.0.0/0.0.0.0:2181:NIOServerCnxn@1044] - Closed socket connection for client /10.1.10.47:47124 which had sessionid 0x365ee3f0f34002c

3个回答

多种原因吧
(1)同步调用,服务端超时
(2)服务端意外停止服务
(3)worker线程池爆池了
(4)服务端限流,导致有些请求无法完成
(5)服务端执行过程中遇到死锁,尤其是数据库死锁。
(6)如果是远程服务,网络波动的概率还是很大的。
等等吧,

windghost817
windghost817 确实是数据库死锁,查到了一段多线程代码里数据库死锁,直接导致server端GC暴涨。
7 个月之前 回复

Dubbo服务提供者出现无法获取Dubbo服务处理线程异常,后端DB爆出拿不到数据库连接池,导致前端响应时间异常飙高,系统处理能力下降,核心基础服务无法提供正常服务
线 上,对于高并发的服务化接口应用,时常会出现Dubbo连接池爆满情况,通常,我们理所应当的认为,这是客户端并发连接过高所致,一方面调整连接池大小, 一方面考虑去增加服务接口的机器,当然也会考虑去优化服务接口的应用

windghost817
windghost817 呃……
10 个月之前 回复

仔细检查consumer和provider的配置文件,zk提供了web版的监控界面可以查看。

Csdn user default icon
上传中...
上传图片
插入图片
抄袭、复制答案,以达到刷声望分或其他目的的行为,在CSDN问答是严格禁止的,一经发现立刻封号。是时候展现真正的技术了!