This is an automated email from the ASF dual-hosted git repository.

albumenj pushed a commit to branch 3.1
in repository https://gitbox.apache.org/repos/asf/dubbo.git


The following commit(s) were added to refs/heads/3.1 by this push:
     new d2db629c17 Remove address invalid check (#11496)
d2db629c17 is described below

commit d2db629c17c0b5287bde6e742542e46f3adb8bdc
Author: Albumen Kevin <[email protected]>
AuthorDate: Tue Feb 7 16:40:09 2023 +0800

    Remove address invalid check (#11496)
    
    * Remove address invalid check
    
    * change code
---
 .../metadata/MetadataServiceNameMapping.java       |  4 +--
 .../support/CacheableFailbackRegistry.java         | 36 +++++++++-------------
 2 files changed, 16 insertions(+), 24 deletions(-)

diff --git 
a/dubbo-registry/dubbo-registry-api/src/main/java/org/apache/dubbo/registry/client/metadata/MetadataServiceNameMapping.java
 
b/dubbo-registry/dubbo-registry-api/src/main/java/org/apache/dubbo/registry/client/metadata/MetadataServiceNameMapping.java
index dd0066fb1a..9908dc9243 100644
--- 
a/dubbo-registry/dubbo-registry-api/src/main/java/org/apache/dubbo/registry/client/metadata/MetadataServiceNameMapping.java
+++ 
b/dubbo-registry/dubbo-registry-api/src/main/java/org/apache/dubbo/registry/client/metadata/MetadataServiceNameMapping.java
@@ -39,8 +39,8 @@ import org.apache.dubbo.rpc.model.ApplicationModel;
 
 import static 
org.apache.dubbo.common.constants.CommonConstants.COMMA_SEPARATOR;
 import static org.apache.dubbo.common.constants.CommonConstants.DEFAULT_KEY;
+import static 
org.apache.dubbo.common.constants.LoggerCodeConstants.COMMON_PROPERTY_TYPE_MISMATCH;
 import static 
org.apache.dubbo.common.constants.LoggerCodeConstants.INTERNAL_ERROR;
-import static 
org.apache.dubbo.common.constants.LoggerCodeConstants.REGISTRY_ADDRESS_INVALID;
 import static org.apache.dubbo.registry.Constants.CAS_RETRY_TIMES_KEY;
 import static org.apache.dubbo.registry.Constants.CAS_RETRY_WAIT_TIME_KEY;
 import static org.apache.dubbo.registry.Constants.DEFAULT_CAS_RETRY_TIMES;
@@ -69,7 +69,7 @@ public class MetadataServiceNameMapping extends 
AbstractServiceNameMapping {
     @Override
     public boolean map(URL url) {
         if 
(CollectionUtils.isEmpty(applicationModel.getApplicationConfigManager().getMetadataConfigs()))
 {
-            logger.warn(REGISTRY_ADDRESS_INVALID, "", "", "No valid metadata 
config center found for mapping report.");
+            logger.warn(COMMON_PROPERTY_TYPE_MISMATCH, "", "", "No valid 
metadata config center found for mapping report.");
             return false;
         }
         String serviceInterface = url.getServiceInterface();
diff --git 
a/dubbo-registry/dubbo-registry-api/src/main/java/org/apache/dubbo/registry/support/CacheableFailbackRegistry.java
 
b/dubbo-registry/dubbo-registry-api/src/main/java/org/apache/dubbo/registry/support/CacheableFailbackRegistry.java
index 60182d6eec..b423691b73 100644
--- 
a/dubbo-registry/dubbo-registry-api/src/main/java/org/apache/dubbo/registry/support/CacheableFailbackRegistry.java
+++ 
b/dubbo-registry/dubbo-registry-api/src/main/java/org/apache/dubbo/registry/support/CacheableFailbackRegistry.java
@@ -16,6 +16,18 @@
  */
 package org.apache.dubbo.registry.support;
 
+import java.util.ArrayList;
+import java.util.Collection;
+import java.util.HashMap;
+import java.util.Iterator;
+import java.util.List;
+import java.util.Map;
+import java.util.Set;
+import java.util.concurrent.ConcurrentHashMap;
+import java.util.concurrent.ScheduledExecutorService;
+import java.util.concurrent.Semaphore;
+import java.util.concurrent.TimeUnit;
+
 import org.apache.dubbo.common.URL;
 import org.apache.dubbo.common.URLBuilder;
 import org.apache.dubbo.common.URLStrParser;
@@ -34,18 +46,6 @@ import org.apache.dubbo.registry.NotifyListener;
 import org.apache.dubbo.registry.ProviderFirstParams;
 import org.apache.dubbo.rpc.model.ScopeModel;
 
-import java.util.ArrayList;
-import java.util.Collection;
-import java.util.HashMap;
-import java.util.Iterator;
-import java.util.List;
-import java.util.Map;
-import java.util.Set;
-import java.util.concurrent.ConcurrentHashMap;
-import java.util.concurrent.ScheduledExecutorService;
-import java.util.concurrent.Semaphore;
-import java.util.concurrent.TimeUnit;
-
 import static org.apache.dubbo.common.URLStrParser.ENCODED_AND_MARK;
 import static org.apache.dubbo.common.URLStrParser.ENCODED_PID_KEY;
 import static org.apache.dubbo.common.URLStrParser.ENCODED_QUESTION_MARK;
@@ -56,12 +56,11 @@ import static 
org.apache.dubbo.common.constants.CommonConstants.CHECK_KEY;
 import static org.apache.dubbo.common.constants.CommonConstants.DUBBO;
 import static org.apache.dubbo.common.constants.CommonConstants.PATH_SEPARATOR;
 import static 
org.apache.dubbo.common.constants.CommonConstants.PROTOCOL_SEPARATOR_ENCODED;
-import static 
org.apache.dubbo.common.constants.LoggerCodeConstants.REGISTRY_ADDRESS_INVALID;
+import static 
org.apache.dubbo.common.constants.LoggerCodeConstants.COMMON_PROPERTY_TYPE_MISMATCH;
 import static 
org.apache.dubbo.common.constants.LoggerCodeConstants.REGISTRY_EMPTY_ADDRESS;
+import static 
org.apache.dubbo.common.constants.LoggerCodeConstants.REGISTRY_FAILED_CLEAR_CACHED_URLS;
 import static 
org.apache.dubbo.common.constants.LoggerCodeConstants.REGISTRY_FAILED_URL_EVICTING;
-import static 
org.apache.dubbo.common.constants.LoggerCodeConstants.COMMON_PROPERTY_TYPE_MISMATCH;
 import static 
org.apache.dubbo.common.constants.LoggerCodeConstants.REGISTRY_NO_PARAMETERS_URL;
-import static 
org.apache.dubbo.common.constants.LoggerCodeConstants.REGISTRY_FAILED_CLEAR_CACHED_URLS;
 import static org.apache.dubbo.common.constants.RegistryConstants.CATEGORY_KEY;
 import static 
org.apache.dubbo.common.constants.RegistryConstants.EMPTY_PROTOCOL;
 import static 
org.apache.dubbo.common.constants.RegistryConstants.ENABLE_EMPTY_PROTECTION_KEY;
@@ -177,10 +176,6 @@ public abstract class CacheableFailbackRegistry extends 
FailbackRegistry {
                 // create DubboServiceAddress object using provider url, 
consumer url, and extra parameters.
                 ServiceAddressURL cachedURL = createURL(rawProvider, 
copyOfConsumer, getExtraParameters());
                 if (cachedURL == null) {
-                    // 1-1: Address invalid.
-                    logger.warn(REGISTRY_ADDRESS_INVALID, "mismatch of service 
group and version settings", "",
-                        "Invalid address, failed to parse into URL " + 
rawProvider);
-
                     continue;
                 }
                 newURLs.put(rawProvider, cachedURL);
@@ -193,9 +188,6 @@ public abstract class CacheableFailbackRegistry extends 
FailbackRegistry {
                 if (cachedURL == null) {
                     cachedURL = createURL(rawProvider, copyOfConsumer, 
getExtraParameters());
                     if (cachedURL == null) {
-                        logger.warn(REGISTRY_ADDRESS_INVALID, "mismatch of 
service group and version settings", "",
-                            "Invalid address, failed to parse into URL " + 
rawProvider);
-
                         continue;
                     }
                 }

Reply via email to