zrlw commented on issue #9239:
URL: https://github.com/apache/dubbo/issues/9239#issuecomment-967111687


   
下午没能重现issue现象的原因很弱鸡,断点设置的dubbo版本和dubbo-samples使用的dubbo版本不一致,所以设置的断点都没有执行到,改成一致版本之后,就可以跟踪了。
   
nacos和zk的确不一样,以dubbo-samples的dubbo-samples-nacos-override为例,启动BasicProvider时,同时有两个线程要解析服务实例的URL列表:
   1. 
线程A执行RegistryProtocol的export方法:调用overrideUrlWithConfig创建ServiceConfigurationListener,通过AbstractConfiguratorListener的initWith方法,直接调用AbstractConfiguratorListener的genConfiguratorsFromRawRule解析URL列表;
   2. 
线程B执行NacosDynamicConfiguration内部NacosConfigListener对象的innerReceive方法:通过AbstractConfiguratorListener的process方法(ADDED事件),调用AbstractConfiguratorListener的genConfiguratorsFromRawRule解析URL列表。
   两个线程解析的rawConfig内容相同,解析出来的URL列表存入的configurators也是同一个对象,不清楚为什么由两个不同的线程重复解析。
   
   
Dubbo-admin我下载了develop当前分支,构建之后测了一下dubbo-samples-nacos-override的动态配置增、删、改,确认和述线程B执行过程相同。
   
   目前看nacos没有zk那样的单独创建node的事件,本ISSUE有两种方案:
   A. ADDED事件内容也尝试解析,解析失败后忽略;
   B. 将Nacos的ADDED改为MODIFIED事件,AbstractConfiguratorListener不解析ADDED事件的内容。
   最终采用哪一个办法还需要各位确定。
   @chickenlj @haoyann @CrazyHZM 
   


-- 
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: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]



---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to