You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@dubbo.apache.org by GitBox <gi...@apache.org> on 2021/11/15 13:08:47 UTC

[GitHub] [dubbo] supercocoa opened a new issue #9278: dubbo心跳超时重连bug

supercocoa opened a new issue #9278:
URL: https://github.com/apache/dubbo/issues/9278


   
   
   ### Environment
   
   * Dubbo version: 2.7.x  3.x
   * Operating System version: any
   * Java version: any
   
   ### Steps to reproduce this issue
   
   1. 关掉zk
   2. providder断点停住,模拟服务hang住或宕机的死连接情况
   3. consummer到时触发ReconnectTimerTask
   4. ReconnectTimerTask里判断连接可用,然后走到else触发超时重连逻辑
   5. 超时重连的reconnect的实现里面又去判断跟step4一样的连接可用逻辑,导致没有去强制重连,等于这个reconnect里的逻辑实际无法生效,即没有在需要重连的时候去强制重连,最终导致死连接的服务没有被摘流,consermer一直往死连接的服务发请求
   ![Xnip2021-11-15_20-31-54](https://user-images.githubusercontent.com/1468623/141785451-4e9e181c-dd05-427a-a39a-e207f6a2f643.jpg)
   
   ![Xnip2021-11-15_20-49-37](https://user-images.githubusercontent.com/1468623/141785485-1a91dbf5-0bce-4ddb-ac1c-3f3c6fdc5020.jpg)
   
   
   ### Expected Behavior
   
   死连接情况,心跳超时重连的时候需要强制重连
   
   ### Actual Behavior
   
   死连接情况,心跳超时重连的时候实际没有去重连
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: notifications-unsubscribe@dubbo.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@dubbo.apache.org
For additional commands, e-mail: notifications-help@dubbo.apache.org


[GitHub] [dubbo] supercocoa edited a comment on issue #9278: dubbo心跳超时重连bug

Posted by GitBox <gi...@apache.org>.
supercocoa edited a comment on issue #9278:
URL: https://github.com/apache/dubbo/issues/9278#issuecomment-971047137


   这个问题最主要是代码逻辑有问题,目前的逻辑心跳超时里的reconnect是永远无法reconnect的
   首先ReconnectTimerTask.doTask里的第一个if判断channel没连上才进的else判超时逻辑,然后reconnect里又重复判断channel没连上才能真正reconnect,那这种情况这个逻辑是永远无法reconnect的


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: notifications-unsubscribe@dubbo.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@dubbo.apache.org
For additional commands, e-mail: notifications-help@dubbo.apache.org


[GitHub] [dubbo] supercocoa commented on issue #9278: dubbo心跳超时重连bug

Posted by GitBox <gi...@apache.org>.
supercocoa commented on issue #9278:
URL: https://github.com/apache/dubbo/issues/9278#issuecomment-971044801


   @BurningCN 服务端直接掉电宕机是无法触发服务端主动关闭的 https://juejin.cn/post/6844903881781018632


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: notifications-unsubscribe@dubbo.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@dubbo.apache.org
For additional commands, e-mail: notifications-help@dubbo.apache.org


[GitHub] [dubbo] AlbumenJ closed issue #9278: dubbo心跳超时重连bug

Posted by GitBox <gi...@apache.org>.
AlbumenJ closed issue #9278:
URL: https://github.com/apache/dubbo/issues/9278


   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: notifications-unsubscribe@dubbo.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@dubbo.apache.org
For additional commands, e-mail: notifications-help@dubbo.apache.org


[GitHub] [dubbo] BurningCN commented on issue #9278: dubbo心跳超时重连bug

Posted by GitBox <gi...@apache.org>.
BurningCN commented on issue #9278:
URL: https://github.com/apache/dubbo/issues/9278#issuecomment-971146600


   > @BurningCN 这个问题最主要是代码逻辑有问题,目前的逻辑心跳超时里的reconnect是永远无法reconnect的 首先ReconnectTimerTask.doTask里的第一个if判断channel没连上才进的else判超时逻辑,然后reconnect里又重复判断channel没连上才能真正reconnect,那这种情况这个逻辑是永远无法reconnect的
   
   的确,ReconnectTimerTask.doTask的else分支和reconnect方法是冲突的。我觉得可以改造下reconnect方法,在原有逻辑的基础上,支持强制重连的方式,直接disConnect+connect,不做额外的状态判断。比如搞一个boolean force参数


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: notifications-unsubscribe@dubbo.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@dubbo.apache.org
For additional commands, e-mail: notifications-help@dubbo.apache.org


[GitHub] [dubbo] supercocoa edited a comment on issue #9278: dubbo心跳超时重连bug

Posted by GitBox <gi...@apache.org>.
supercocoa edited a comment on issue #9278:
URL: https://github.com/apache/dubbo/issues/9278#issuecomment-971047137


   @BurningCN  这个问题最主要是代码逻辑有问题,目前的逻辑心跳超时里的reconnect是永远无法reconnect的
   首先ReconnectTimerTask.doTask里的第一个if判断channel没连上才进的else判超时逻辑,然后reconnect里又重复判断channel没连上才能真正reconnect,那这种情况这个逻辑是永远无法reconnect的


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: notifications-unsubscribe@dubbo.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@dubbo.apache.org
For additional commands, e-mail: notifications-help@dubbo.apache.org


[GitHub] [dubbo] supercocoa commented on issue #9278: dubbo心跳超时重连bug

Posted by GitBox <gi...@apache.org>.
supercocoa commented on issue #9278:
URL: https://github.com/apache/dubbo/issues/9278#issuecomment-971047137


   
   这个问题最主要是代码逻辑有问题,目前的逻辑心跳超时里的reconnect是永远无法reconnect的


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: notifications-unsubscribe@dubbo.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@dubbo.apache.org
For additional commands, e-mail: notifications-help@dubbo.apache.org


[GitHub] [dubbo] BurningCN commented on issue #9278: dubbo心跳超时重连bug

Posted by GitBox <gi...@apache.org>.
BurningCN commented on issue #9278:
URL: https://github.com/apache/dubbo/issues/9278#issuecomment-969929283


   情况1:正常情况,心跳空闲超时之后,服务端会触发空闲事件,从而发起channel的关闭操作,使得客户端是能收到断连事件的,触发channelInActive方法的,从而更新channel的状态。因此可以正常发起重连。
   情况2:服务端宕机,无法正常触发服务端主动关闭的流程,但是客户端的NettyClientHandler还是会触发channelInActive方法的,从而更新channel的状态。因此可以正常发起重连
   
   而如你描述的情况,你将服务端断点停住,本身测试的逻辑就有点问题,服务端本身并没有宕机,客户端和服务端还是链接着的。所以客户端无法发起重连。


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: notifications-unsubscribe@dubbo.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@dubbo.apache.org
For additional commands, e-mail: notifications-help@dubbo.apache.org