zrlw edited a comment 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执行过程相同(事件分别为ADDED、MODIFIED、DELETED)。
   
   目前看nacos没有zk那样的单独创建node的事件。
   @chickenlj @haoyann @CrazyHZM 
   
   更新:
   zk创建节点时如果用的是forPath(path, 
rawConfig.getBytes())而不是forPath(path),zk的ADDED事件content也是有内容的。
   所以ADDED事件还是需要解析。


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