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/09/09 11:09:57 UTC

[GitHub] [dubbo] zrlw opened a new issue #8752: 消费端尝试访问错误地址端口的ReconnectTimerTask没有停止机制

zrlw opened a new issue #8752:
URL: https://github.com/apache/dubbo/issues/8752


   ### Environment
   
   * Dubbo version: 3.0 2.7.x
   
   ### Steps to reproduce this issue
   1. 服务端配错了端口注册到了注册中心,但是防火墙没有开启消费端到服务端这个端口的策略
   2. 消费端从注册中心正常订阅到服务端的url,建立连接时被防火墙阻断,开始ReconnectTimerTask自动重连
   3. 服务修改端口后重新启动,又注册到注册中心了
   但是消费端的ReconnectTimerTask依然锲而不舍地在重连旧url。
   服务实例注销后,ReconnectTimerTask的相关任务应该同步注销。


-- 
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] zrlw closed issue #8752: 一个消费端包含多个引用同一服务接口的DubboReference时,ReconnectTimerTask任务在服务端修订地址端口重新注册后仍然不断尝试连接旧地址

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


   


-- 
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] zrlw edited a comment on issue #8752: 一个消费端包含多个引用同一服务接口的DubboReference时,ReconnectTimerTask任务在服务端修订地址端口重新注册后仍然不断尝试连接旧地址

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


   referenceCount 应该和 DubboInvoker 实例的数量相等,只是你看看ServiceDiscoveryRegistryDirectory的urlInvokerMap结构,你就明白了。
   这个map是当client收到注册中心notify时对URL相关的invoker进行更新的,key是URL,value是这个URL对应的其中一个invoker,但是这个URL对应的invoker并不都是由ServiceDiscoveryRegistryDirectory创建的,当初我曾尝试过把这个map的value搞成set集合,但是发现要伤筋动骨大改,涉及的内容太多了,就退回来搞了个destryAll。
   ServiceDiscoveryRegistryDirectory里的urlInvokerMap保存的invoker只是收到注册中心服务实例通知时创建的invoker。


-- 
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] zrlw commented on issue #8752: 一个消费端包含多个引用同一服务接口的DubboReference时,ReconnectTimerTask任务在服务端修订地址端口重新注册后仍然不断尝试连接旧地址

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


   referenceCount 应该和 DubboInvoker 实例的数量相等,只是你看看ServiceDiscoveryRegistryDirectory的urlInvokerMap结构,你就明白了。
   这个map是当client收到注册中心notify时对URL相关的invoker进行更新的,key是URL,value是这个URL对应的最后一个invoker,所以只能操作一个invoker,当初我曾尝试过把这个map的value搞成set集合,但是发现要伤筋动骨大改,涉及的内容太多了,就退回来搞了个destryAll。


-- 
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] zrlw edited a comment on issue #8752: 一个消费端包含多个引用同一服务接口的DubboReference时,ReconnectTimerTask任务在服务端修订地址端口重新注册后仍然不断尝试连接旧地址

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


   destroyAllInvokers被调用时,如果其中一个invoker的client是ReferenceCountExchangeClient,那么URL有多个invoker时,只做一次close,ReferenceCountExchangeClient也不会实际关闭,因为刚才说了,urlInvokerMap保存的invoker只是收到注册中心服务实例通知时创建的invoker,并不是全部invoker。


-- 
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] zrlw commented on issue #8752: 一个消费端包含多个引用同一服务接口的DubboReference时,ReconnectTimerTask任务在服务端修订地址端口重新注册后仍然不断尝试连接旧地址

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


   destroyAllInvokers被调用时,如果其中一个invoker的client是ReferenceCountExchangeClient,那么URL有多个invoker时,只做一次close,ReferenceCountExchangeClient也不会实际关闭。


-- 
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] PepoRobert edited a comment on issue #8752: 一个消费端包含多个引用同一服务接口的DubboReference时,ReconnectTimerTask任务在服务端修订地址端口重新注册后仍然不断尝试连接旧地址

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


   dubbp spi 会对 invoker 进行wrapper  如果wrapper  没有实现destroyAll的话还是只会调用默认的destroy方法。我们用3.0.5发现仍会报这个异常debug 发现urlInvokerMap的invoke实际类型为ProtocolListenerWrapper 


-- 
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] zrlw edited a comment on issue #8752: 一个消费端包含多个引用同一服务接口的DubboReference时,ReconnectTimerTask任务在服务端修订地址端口重新注册后仍然不断尝试连接旧地址

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


   referenceCount 应该和 DubboInvoker 实例的数量相等,只是你看看ServiceDiscoveryRegistryDirectory的urlInvokerMap结构,你就明白了。
   这个map是当client收到注册中心notify时对URL相关的invoker进行更新的,key是URL,value是这个URL对应的其中一个invoker,但是这个URL对应的invoker并不都是由ServiceDiscoveryRegistryDirectory创建的,当初我曾尝试过把这个map的value搞成set集合,但是发现要伤筋动骨大改,涉及的内容太多了,就退回来搞了个destryAll。


-- 
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] zrlw edited a comment on issue #8752: 一个消费端包含多个引用同一服务接口的DubboReference时,ReconnectTimerTask任务在服务端修订地址端口重新注册后仍然不断尝试连接旧地址

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


   URL修改时,注册中心只会通知1次,destroyUnusedInvokers会被触发,只关一次,那么该URL有多个invoker时,这就会造成持续尝试连接旧URL的问题。


-- 
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] PepoRobert commented on issue #8752: 一个消费端包含多个引用同一服务接口的DubboReference时,ReconnectTimerTask任务在服务端修订地址端口重新注册后仍然不断尝试连接旧地址

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


   dubbp spi 会对 invoker 进行wrapper  如果wrapper  没有实现destroyAll的话还是只会调用默认的destroy方法


-- 
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] chickenlj commented on issue #8752: 一个消费端包含多个引用同一服务接口的DubboReference时,ReconnectTimerTask任务在服务端修订地址端口重新注册后仍然不断尝试连接旧地址

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


   我不确定为什么需要 destroyAll 接口:
   1. 如果 Directory.destroyAllInvokers() 被调用了,只是最终client关闭会稍微延迟一些,因为中间有一些invoker迭代过程,但这也符合未关闭的invoker的状态
   2. 如果只是 Directory.destroyUnusedInvokers() 被调用了,则会根据实际关闭的invoker数量决定client是否应该被关闭。
   
   > ReferenceCountExchangeClient的referenceCount大于1,只close一次只是把referenceCount减一而已,不会实际关闭。
   
   referenceCount 应该和 DubboInvoker 实例的数量严格相等,和reference多次没有关系吧?


-- 
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] zrlw commented on issue #8752: 一个消费端包含多个引用同一服务接口的DubboReference时,ReconnectTimerTask任务在服务端修订地址端口重新注册后仍然不断尝试连接旧地址

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


   URL修改时,注册中心只会通知1次,destroyUnusedInvokers会被触发,只关一个invoker,那么该URL有多个invoker时,这就会造成持续尝试连接旧URL的问题。


-- 
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