You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@dubbo.apache.org by "AlbumenJ (via GitHub)" <gi...@apache.org> on 2023/03/23 11:57:07 UTC

[GitHub] [dubbo] AlbumenJ commented on a diff in pull request #11875: fix the problem that dynamic configuration does not work after reboot

AlbumenJ commented on code in PR #11875:
URL: https://github.com/apache/dubbo/pull/11875#discussion_r1146073738


##########
dubbo-registry/dubbo-registry-api/src/main/java/org/apache/dubbo/registry/integration/RegistryDirectory.java:
##########
@@ -114,11 +114,11 @@ public RegistryDirectory(Class<T> serviceType, URL url) {
 
     @Override
     public void subscribe(URL url) {
-        super.subscribe(url);
         if (moduleModel.getModelEnvironment().getConfiguration().convert(Boolean.class, org.apache.dubbo.registry.Constants.ENABLE_CONFIGURATION_LISTEN, true)) {
             consumerConfigurationListener.addNotifyListener(this);
             referenceConfigurationListener = new ReferenceConfigurationListener(moduleModel, this, url);
         }
+        super.subscribe(url);

Review Comment:
   这里应该有两个规则的处理点,一个是在 RegistryDirectory 另外是在 ServiceDiscoveryRegistryDirectory。
   按照通用一些的做法应该是订阅后马上推送一次最新的规则覆盖,这样可以保证规则是一直最新的。
   如果提前订阅规则再注册中心订阅可能导致一些非预期的时序问题。



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