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/11/18 04:54:34 UTC

[GitHub] [dubbo] zrlw commented on a change in pull request #9248: [3.0] fix AbstractConfiguratorListener#genConfiguratorsFromRawRule to support event content that has single ip

zrlw commented on a change in pull request #9248:
URL: https://github.com/apache/dubbo/pull/9248#discussion_r751905006



##########
File path: dubbo-registry/dubbo-registry-api/src/main/java/org/apache/dubbo/registry/integration/AbstractConfiguratorListener.java
##########
@@ -103,21 +103,27 @@ public void process(ConfigChangedEvent event) {
     }
 
     private boolean genConfiguratorsFromRawRule(String rawConfig) {
-        boolean parseSuccess = true;
+        List<URL> urls;
         try {
             // parseConfigurators will recognize app/service config automatically.
-            List<URL> urls = ConfigParser.parseConfigurators(rawConfig);
-            List<URL> safeUrls = urls.stream()
-                .map(url -> url.removeParameters(securityKey))
-                .map(url -> url.setScopeModel(moduleModel))
-                .collect(Collectors.toList());
-            configurators = Configurator.toConfigurators(safeUrls).orElse(configurators);
+            urls = ConfigParser.parseConfigurators(rawConfig);
         } catch (Exception e) {
-            logger.error("Failed to parse raw dynamic config and it will not take effect, the raw config is: " +
-                    rawConfig, e);
-            parseSuccess = false;
+            // support single ip (issue: #8821 #9239)
+            URL url = URL.valueOf(rawConfig);

Review comment:
       org.apache.dubbo.remoting.zookeeper.curator#createPersistent(String path) and createEphemeral(String path) will call
   org.apache.curator.framework.imps.CreateBuilderImpl#forPath(path) and transfer client.getDefaultData() - client ip address - as dataChanged event content to the provider's org.apache.dubbo.remoting.zookeeper.curator.CuratorZookeeperClient#NodeCacheListenerImpl#nodeChanged. 
   if client ip address is not acceptable, it should be filtered out of the event process instead of being processed by AbstractConfiguratorListener.




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