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/17 10:52:04 UTC

[GitHub] [dubbo] zjutbang opened a new issue #8839: dubbo使用nacos做多注册中心,重启服务会导致provider被覆盖

zjutbang opened a new issue #8839:
URL: https://github.com/apache/dubbo/issues/8839


   ### Environment
   
   * Dubbo version: 2.7.12
   * Java version: 1.8
   
   ### Steps to reproduce this issue
   
   1. 配置多个nacos注册中心
   2. 启动provider和consumer服务
   3. 重启某个注册中心的provider服务,会导致另一个注册中心的provider也变成这个重启的provider
   
   ### 源码解读发现逻辑问题
   1. com.alibaba.nacos.client.naming.core.HostReactor#processServiceJson里会发布InstancesChangeEvent,这个事件会通知所有naocs注册中心的服务。
   2. 会触发这个方法org.apache.dubbo.registry.nacos.NacosRegistry#subscribeEventListener里定义的eventListener。
   3. 之后org.apache.dubbo.registry.integration.RegistryDirectory#refreshOverrideAndInvoker 会更新routerChain.setInvokers(newInvokers)。
   4. 这里的newInvokers代表重启后的服务provider
   5. 最后的结果就导致不同nacos注册中心的对应的RegistryDirectory对象,invokers都被更新成了一个


-- 
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] CrazyHZM commented on issue #8839: dubbo使用nacos做多注册中心,重启服务会导致provider被覆盖

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


   repeat:https://github.com/apache/dubbo/issues/8838


-- 
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] CrazyHZM closed issue #8839: dubbo使用nacos做多注册中心,重启服务会导致provider被覆盖

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


   


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