You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@dubbo.apache.org by al...@apache.org on 2022/12/27 03:44:07 UTC

[dubbo] branch 3.1 updated: Merge error code 1-36 to 99-0. (#11207)

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 992e125a1a Merge error code 1-36 to 99-0. (#11207)
992e125a1a is described below

commit 992e125a1a5f6b50178876d4fb25dee70c2c5ff1
Author: Andy Cheung <mi...@msn.cn>
AuthorDate: Tue Dec 27 11:43:51 2022 +0800

    Merge error code 1-36 to 99-0. (#11207)
    
    * Merge 1-36 to 99-0.
    
    * Merge 1-36 to 99-0. (2)
    
    * Merge 1-36 to 99-0. (3)
    
    * Merge 1-36 to 99-0. (4)
---
 .../wrapper/CompositeDynamicConfiguration.java      |  4 ++--
 .../dubbo/common/constants/LoggerCodeConstants.java | 21 ++++++++++++++++-----
 .../dubbo/registry/ListenerRegistryWrapper.java     |  4 ++--
 .../registry/client/ServiceDiscoveryRegistry.java   |  6 +++---
 .../listener/ServiceInstancesChangedListener.java   | 14 +++++++-------
 .../client/metadata/MetadataServiceNameMapping.java |  4 ++--
 .../client/migration/MigrationRuleHandler.java      |  4 ++--
 .../client/migration/MigrationRuleListener.java     |  8 ++++----
 .../registry/integration/RegistryProtocol.java      | 10 +++++-----
 .../dubbo/registry/support/AbstractRegistry.java    |  4 ++--
 .../dubbo/registry/support/FailbackRegistry.java    |  6 +++---
 .../dubbo/registry/support/RegistryManager.java     |  4 ++--
 12 files changed, 50 insertions(+), 39 deletions(-)

diff --git a/dubbo-common/src/main/java/org/apache/dubbo/common/config/configcenter/wrapper/CompositeDynamicConfiguration.java b/dubbo-common/src/main/java/org/apache/dubbo/common/config/configcenter/wrapper/CompositeDynamicConfiguration.java
index d9f6e3d30d..2925d7a4bc 100644
--- a/dubbo-common/src/main/java/org/apache/dubbo/common/config/configcenter/wrapper/CompositeDynamicConfiguration.java
+++ b/dubbo-common/src/main/java/org/apache/dubbo/common/config/configcenter/wrapper/CompositeDynamicConfiguration.java
@@ -26,7 +26,7 @@ import java.util.Set;
 import java.util.function.Consumer;
 import java.util.function.Function;
 
-import static org.apache.dubbo.common.constants.LoggerCodeConstants.REGISTRY_UNEXPECTED_EXCEPTION;
+import static org.apache.dubbo.common.constants.LoggerCodeConstants.INTERNAL_ERROR;
 
 /**
  * support multiple config center, simply iterating each concrete config center.
@@ -92,7 +92,7 @@ public class CompositeDynamicConfiguration implements DynamicConfiguration {
             try {
                 configuration.close();
             } catch (Exception e) {
-                logger.warn(REGISTRY_UNEXPECTED_EXCEPTION, "", "", "close dynamic configuration " + configuration.getClass().getName() + "failed: " + e.getMessage(), e);
+                logger.warn(INTERNAL_ERROR, "unknown error in configuration-center related code in common module", "", "close dynamic configuration " + configuration.getClass().getName() + "failed: " + e.getMessage(), e);
             }
         }
         configurations.clear();
diff --git a/dubbo-common/src/main/java/org/apache/dubbo/common/constants/LoggerCodeConstants.java b/dubbo-common/src/main/java/org/apache/dubbo/common/constants/LoggerCodeConstants.java
index 382c9d5eca..bd33f16ea4 100644
--- a/dubbo-common/src/main/java/org/apache/dubbo/common/constants/LoggerCodeConstants.java
+++ b/dubbo-common/src/main/java/org/apache/dubbo/common/constants/LoggerCodeConstants.java
@@ -18,11 +18,11 @@
 package org.apache.dubbo.common.constants;
 
 /**
- * constants for logger
+ * Constants of Error codes used in logger.
  */
 public interface LoggerCodeConstants {
 
-    // common module
+    // Common module
     String COMMON_THREAD_POOL_EXHAUSTED = "0-1";
 
     String COMMON_PROPERTY_TYPE_MISMATCH = "0-2";
@@ -75,9 +75,13 @@ public interface LoggerCodeConstants {
 
     String COMMON_METADATA_PROCESSOR = "0-26";
 
-    // registry module
+    // Registry module
+    
     String REGISTRY_ADDRESS_INVALID = "1-1";
 
+    /**
+     * Absent. Merged with 0-2.
+     */
     String REGISTRY_ABSENCE = "1-2";
 
     String REGISTRY_FAILED_URL_EVICTING = "1-3";
@@ -146,6 +150,9 @@ public interface LoggerCodeConstants {
 
     String REGISTRY_ZOOKEEPER_EXCEPTION = "1-35";
 
+    /**
+     * Absent. Merged with 99-0.
+     */
     String REGISTRY_UNEXPECTED_EXCEPTION = "1-36";
 
     String REGISTRY_NACOS_EXCEPTION = "1-37";
@@ -195,7 +202,7 @@ public interface LoggerCodeConstants {
 
     String CLUSTER_FAILED_GROUP_MERGE = "2-20";
 
-    // proxy module
+    // Proxy module.
     String PROXY_FAILED_CONVERT_URL = "3-1";
 
     String PROXY_FAILED_EXPORT_SERVICE = "3-2";
@@ -210,7 +217,7 @@ public interface LoggerCodeConstants {
 
     String PROXY_TIMEOUT_RESPONSE = "3-7";
 
-    // protocol module
+    // Protocol module.
     String PROTOCOL_UNSUPPORTED = "4-1";
 
     String PROTOCOL_FAILED_INIT_SERIALIZATION_OPTIMIZER = "4-2";
@@ -379,6 +386,10 @@ public interface LoggerCodeConstants {
     String QOS_UNEXPECTED_EXCEPTION = "7-6";
 
     // Internal unknown error.
+
+    /**
+     * Unknown internal error. (99-0)
+     */
     String INTERNAL_ERROR = "99-0";
 
     String INTERNAL_INTERRUPTED = "99-1";
diff --git a/dubbo-registry/dubbo-registry-api/src/main/java/org/apache/dubbo/registry/ListenerRegistryWrapper.java b/dubbo-registry/dubbo-registry-api/src/main/java/org/apache/dubbo/registry/ListenerRegistryWrapper.java
index 540e93f394..55418c99ae 100644
--- a/dubbo-registry/dubbo-registry-api/src/main/java/org/apache/dubbo/registry/ListenerRegistryWrapper.java
+++ b/dubbo-registry/dubbo-registry-api/src/main/java/org/apache/dubbo/registry/ListenerRegistryWrapper.java
@@ -26,7 +26,7 @@ import org.apache.dubbo.common.utils.UrlUtils;
 import java.util.List;
 import java.util.function.Consumer;
 
-import static org.apache.dubbo.common.constants.LoggerCodeConstants.REGISTRY_UNEXPECTED_EXCEPTION;
+import static org.apache.dubbo.common.constants.LoggerCodeConstants.INTERNAL_ERROR;
 
 public class ListenerRegistryWrapper implements Registry {
     private static final ErrorTypeAwareLogger logger = LoggerFactory.getErrorTypeAwareLogger(ListenerRegistryWrapper.class);
@@ -125,7 +125,7 @@ public class ListenerRegistryWrapper implements Registry {
                     try {
                         consumer.accept(listener);
                     } catch (RuntimeException t) {
-                        logger.error(REGISTRY_UNEXPECTED_EXCEPTION, "", "", t.getMessage(), t);
+                        logger.error(INTERNAL_ERROR, "unknown error in registry module", "", t.getMessage(), t);
                         exception = t;
                     }
                 }
diff --git a/dubbo-registry/dubbo-registry-api/src/main/java/org/apache/dubbo/registry/client/ServiceDiscoveryRegistry.java b/dubbo-registry/dubbo-registry-api/src/main/java/org/apache/dubbo/registry/client/ServiceDiscoveryRegistry.java
index 81c138d6fa..6094cd969d 100644
--- a/dubbo-registry/dubbo-registry-api/src/main/java/org/apache/dubbo/registry/client/ServiceDiscoveryRegistry.java
+++ b/dubbo-registry/dubbo-registry-api/src/main/java/org/apache/dubbo/registry/client/ServiceDiscoveryRegistry.java
@@ -41,7 +41,7 @@ import java.util.concurrent.locks.ReentrantLock;
 import static org.apache.dubbo.common.constants.CommonConstants.CHECK_KEY;
 import static org.apache.dubbo.common.constants.CommonConstants.INTERFACE_KEY;
 import static org.apache.dubbo.common.constants.CommonConstants.PROVIDER_SIDE;
-import static org.apache.dubbo.common.constants.LoggerCodeConstants.REGISTRY_UNEXPECTED_EXCEPTION;
+import static org.apache.dubbo.common.constants.LoggerCodeConstants.INTERNAL_ERROR;
 import static org.apache.dubbo.common.constants.RegistryConstants.REGISTRY_CLUSTER_KEY;
 import static org.apache.dubbo.common.constants.RegistryConstants.REGISTRY_TYPE_KEY;
 import static org.apache.dubbo.common.constants.RegistryConstants.SERVICE_REGISTRY_TYPE;
@@ -203,7 +203,7 @@ public class ServiceDiscoveryRegistry extends FailbackRegistry {
                 subscribedServices = serviceNameMapping.getAndListen(this.getUrl(), url, mappingListener);
                 mappingListeners.put(url.getProtocolServiceKey(), mappingListener);
             } catch (Exception e) {
-                logger.warn(REGISTRY_UNEXPECTED_EXCEPTION, "", "", "Cannot find app mapping for service " + url.getServiceInterface() + ", will not migrate.", e);
+                logger.warn(INTERNAL_ERROR, "unknown error in registry module", "", "Cannot find app mapping for service " + url.getServiceInterface() + ", will not migrate.", e);
             }
 
             if (CollectionUtils.isEmpty(subscribedServices)) {
@@ -366,7 +366,7 @@ public class ServiceDiscoveryRegistry extends FailbackRegistry {
             logger.info("Received mapping notification from meta server, " + event);
 
             if (stopped) {
-                logger.warn(REGISTRY_UNEXPECTED_EXCEPTION, "", "", "Listener has been stopped, ignore mapping notification, check why listener is not removed.");
+                logger.warn(INTERNAL_ERROR, "", "", "Listener has been stopped, ignore mapping notification, check why listener is not removed.");
                 return;
             }
             Set<String> newApps = event.getApps();
diff --git a/dubbo-registry/dubbo-registry-api/src/main/java/org/apache/dubbo/registry/client/event/listener/ServiceInstancesChangedListener.java b/dubbo-registry/dubbo-registry-api/src/main/java/org/apache/dubbo/registry/client/event/listener/ServiceInstancesChangedListener.java
index a28387ce6b..6196331538 100644
--- a/dubbo-registry/dubbo-registry-api/src/main/java/org/apache/dubbo/registry/client/event/listener/ServiceInstancesChangedListener.java
+++ b/dubbo-registry/dubbo-registry-api/src/main/java/org/apache/dubbo/registry/client/event/listener/ServiceInstancesChangedListener.java
@@ -56,7 +56,7 @@ import java.util.concurrent.atomic.AtomicBoolean;
 
 import static org.apache.dubbo.common.constants.CommonConstants.PROTOCOL_KEY;
 import static org.apache.dubbo.common.constants.LoggerCodeConstants.REGISTRY_FAILED_REFRESH_ADDRESS;
-import static org.apache.dubbo.common.constants.LoggerCodeConstants.REGISTRY_UNEXPECTED_EXCEPTION;
+import static org.apache.dubbo.common.constants.LoggerCodeConstants.INTERNAL_ERROR;
 import static org.apache.dubbo.common.constants.RegistryConstants.EMPTY_PROTOCOL;
 import static org.apache.dubbo.common.constants.RegistryConstants.ENABLE_EMPTY_PROTECTION_KEY;
 import static org.apache.dubbo.metadata.RevisionResolver.EMPTY_REVISION;
@@ -179,9 +179,9 @@ public class ServiceInstancesChangedListener {
                 try {
                     retryFuture = scheduler.schedule(new AddressRefreshRetryTask(retryPermission, event.getServiceName()), 10_000L, TimeUnit.MILLISECONDS);
                 } catch (Exception e) {
-                    logger.error(REGISTRY_UNEXPECTED_EXCEPTION, "", "", "Error submitting async retry task.");
+                    logger.error(INTERNAL_ERROR, "unknown error in registry module", "", "Error submitting async retry task.");
                 }
-                logger.warn(REGISTRY_UNEXPECTED_EXCEPTION, "", "", "Address refresh try task submitted");
+                logger.warn(INTERNAL_ERROR, "unknown error in registry module", "", "Address refresh try task submitted");
             }
 
             // return if all metadata is empty, this notification will not take effect.
@@ -291,12 +291,12 @@ public class ServiceInstancesChangedListener {
     protected boolean isRetryAndExpired(ServiceInstancesChangedEvent event) {
         if (event instanceof RetryServiceInstancesChangedEvent) {
             RetryServiceInstancesChangedEvent retryEvent = (RetryServiceInstancesChangedEvent) event;
-            logger.warn(REGISTRY_UNEXPECTED_EXCEPTION, "", "", "Received address refresh retry event, " + retryEvent.getFailureRecordTime());
+            logger.warn(INTERNAL_ERROR, "unknown error in registry module", "", "Received address refresh retry event, " + retryEvent.getFailureRecordTime());
             if (retryEvent.getFailureRecordTime() < lastRefreshTime && !hasEmptyMetadata) {
-                logger.warn(REGISTRY_UNEXPECTED_EXCEPTION, "", "", "Ignore retry event, event time: " + retryEvent.getFailureRecordTime() + ", last refresh time: " + lastRefreshTime);
+                logger.warn(INTERNAL_ERROR, "unknown error in registry module", "", "Ignore retry event, event time: " + retryEvent.getFailureRecordTime() + ", last refresh time: " + lastRefreshTime);
                 return true;
             }
-            logger.warn(REGISTRY_UNEXPECTED_EXCEPTION, "", "", "Retrying address notification...");
+            logger.warn(INTERNAL_ERROR, "unknown error in registry module", "", "Retrying address notification...");
         }
         return false;
     }
@@ -340,7 +340,7 @@ public class ServiceInstancesChangedListener {
 
         if (emptyMetadataNum > 0) {
             builder.insert(0, emptyMetadataNum + "/" + revisionToInstances.size() + " revisions failed to get metadata from remote: ");
-            logger.error(REGISTRY_UNEXPECTED_EXCEPTION, "", "", builder.toString());
+            logger.error(INTERNAL_ERROR, "unknown error in registry module", "", builder.toString());
         } else {
             builder.insert(0, revisionToInstances.size() + " unique working revisions: ");
             logger.info(builder.toString());
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 10f6fe1db3..d12e3e8658 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
@@ -38,7 +38,7 @@ import java.util.Set;
 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.REGISTRY_ADDRESS_INVALID;
-import static org.apache.dubbo.common.constants.LoggerCodeConstants.REGISTRY_UNEXPECTED_EXCEPTION;
+import static org.apache.dubbo.common.constants.LoggerCodeConstants.INTERNAL_ERROR;
 
 public class MetadataServiceNameMapping extends AbstractServiceNameMapping {
 
@@ -101,7 +101,7 @@ public class MetadataServiceNameMapping extends AbstractServiceNameMapping {
                 }
             } catch (Exception e) {
                 result = false;
-                logger.warn(REGISTRY_UNEXPECTED_EXCEPTION, "", "", "Failed registering mapping to remote." + metadataReport, e);
+                logger.warn(INTERNAL_ERROR, "unknown error in registry module", "", "Failed registering mapping to remote." + metadataReport, e);
             }
         }
 
diff --git a/dubbo-registry/dubbo-registry-api/src/main/java/org/apache/dubbo/registry/client/migration/MigrationRuleHandler.java b/dubbo-registry/dubbo-registry-api/src/main/java/org/apache/dubbo/registry/client/migration/MigrationRuleHandler.java
index 9f923f29f9..334a180a43 100644
--- a/dubbo-registry/dubbo-registry-api/src/main/java/org/apache/dubbo/registry/client/migration/MigrationRuleHandler.java
+++ b/dubbo-registry/dubbo-registry-api/src/main/java/org/apache/dubbo/registry/client/migration/MigrationRuleHandler.java
@@ -24,7 +24,7 @@ import org.apache.dubbo.registry.client.migration.model.MigrationRule;
 import org.apache.dubbo.registry.client.migration.model.MigrationStep;
 
 import static org.apache.dubbo.common.constants.LoggerCodeConstants.REGISTRY_NO_PARAMETERS_URL;
-import static org.apache.dubbo.common.constants.LoggerCodeConstants.REGISTRY_UNEXPECTED_EXCEPTION;
+import static org.apache.dubbo.common.constants.LoggerCodeConstants.INTERNAL_ERROR;
 
 public class MigrationRuleHandler<T> {
     public static final String DUBBO_SERVICEDISCOVERY_MIGRATION = "dubbo.application.migration.step";
@@ -89,7 +89,7 @@ public class MigrationRuleHandler<T> {
                 report(step, originStep, "true");
             } else {
                 // migrate failed, do not save new step and rule
-                logger.warn(REGISTRY_UNEXPECTED_EXCEPTION, "", "", "Migrate to " + step + " mode failed. Probably not satisfy the threshold you set "
+                logger.warn(INTERNAL_ERROR, "unknown error in registry module", "", "Migrate to " + step + " mode failed. Probably not satisfy the threshold you set "
                     + threshold + ". Please try re-publish configuration if you still after check.");
                 report(step, originStep, "false");
             }
diff --git a/dubbo-registry/dubbo-registry-api/src/main/java/org/apache/dubbo/registry/client/migration/MigrationRuleListener.java b/dubbo-registry/dubbo-registry-api/src/main/java/org/apache/dubbo/registry/client/migration/MigrationRuleListener.java
index eb8da5c99c..764b0c0d33 100644
--- a/dubbo-registry/dubbo-registry-api/src/main/java/org/apache/dubbo/registry/client/migration/MigrationRuleListener.java
+++ b/dubbo-registry/dubbo-registry-api/src/main/java/org/apache/dubbo/registry/client/migration/MigrationRuleListener.java
@@ -52,7 +52,7 @@ import java.util.concurrent.atomic.AtomicBoolean;
 import static org.apache.dubbo.common.constants.LoggerCodeConstants.COMMON_THREAD_INTERRUPTED_EXCEPTION;
 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_UNEXPECTED_EXCEPTION;
+import static org.apache.dubbo.common.constants.LoggerCodeConstants.INTERNAL_ERROR;
 import static org.apache.dubbo.common.constants.RegistryConstants.INIT;
 
 /**
@@ -194,18 +194,18 @@ public class MigrationRuleListener implements RegistryProtocolListener, Configur
                                 try {
                                     future.get();
                                 } catch (InterruptedException ie) {
-                                    logger.warn(REGISTRY_UNEXPECTED_EXCEPTION, "", "", "Interrupted while waiting for migration async task to finish.");
+                                    logger.warn(INTERNAL_ERROR, "unknown error in registry module", "", "Interrupted while waiting for migration async task to finish.");
                                 } catch (ExecutionException ee) {
                                     migrationException = ee.getCause();
                                 }
                             }
                             if (migrationException != null) {
-                                logger.error(REGISTRY_UNEXPECTED_EXCEPTION, "", "", "Migration async task failed.", migrationException);
+                                logger.error(INTERNAL_ERROR, "unknown error in registry module", "", "Migration async task failed.", migrationException);
                             }
                             executorService.shutdown();
                         }
                     } catch (Throwable t) {
-                        logger.error(REGISTRY_UNEXPECTED_EXCEPTION, "", "", "Error occurred when migration.", t);
+                        logger.error(INTERNAL_ERROR, "unknown error in registry module", "", "Error occurred when migration.", t);
                     }
                 }
             });
diff --git a/dubbo-registry/dubbo-registry-api/src/main/java/org/apache/dubbo/registry/integration/RegistryProtocol.java b/dubbo-registry/dubbo-registry-api/src/main/java/org/apache/dubbo/registry/integration/RegistryProtocol.java
index a993d8e35d..d7ce4f1ba4 100644
--- a/dubbo-registry/dubbo-registry-api/src/main/java/org/apache/dubbo/registry/integration/RegistryProtocol.java
+++ b/dubbo-registry/dubbo-registry-api/src/main/java/org/apache/dubbo/registry/integration/RegistryProtocol.java
@@ -91,7 +91,7 @@ import static org.apache.dubbo.common.constants.CommonConstants.SIDE_KEY;
 import static org.apache.dubbo.common.constants.CommonConstants.TIMEOUT_KEY;
 import static org.apache.dubbo.common.constants.CommonConstants.VERSION_KEY;
 import static org.apache.dubbo.common.constants.FilterConstants.VALIDATION_KEY;
-import static org.apache.dubbo.common.constants.LoggerCodeConstants.REGISTRY_UNEXPECTED_EXCEPTION;
+import static org.apache.dubbo.common.constants.LoggerCodeConstants.INTERNAL_ERROR;
 import static org.apache.dubbo.common.constants.LoggerCodeConstants.REGISTRY_UNSUPPORTED_CATEGORY;
 import static org.apache.dubbo.common.constants.QosConstants.ACCEPT_FOREIGN_IP;
 import static org.apache.dubbo.common.constants.QosConstants.QOS_ENABLE;
@@ -746,7 +746,7 @@ public class RegistryProtocol implements Protocol, ScopeModelAware {
             String key = getCacheKey(originInvoker);
             ExporterChangeableWrapper<?> exporter = bounds.get(key);
             if (exporter == null) {
-                logger.warn(REGISTRY_UNEXPECTED_EXCEPTION, "", "", "error state, exporter should not be null", new IllegalStateException("error state, exporter should not be null"));
+                logger.warn(INTERNAL_ERROR, "unknown error in registry module", "", "error state, exporter should not be null", new IllegalStateException("error state, exporter should not be null"));
                 return;
             }
             //The current, may have been merged many times
@@ -893,7 +893,7 @@ public class RegistryProtocol implements Protocol, ScopeModelAware {
             try {
                 registry.unregister(registerUrl);
             } catch (Throwable t) {
-                logger.warn(REGISTRY_UNEXPECTED_EXCEPTION, "", "", t.getMessage(), t);
+                logger.warn(INTERNAL_ERROR, "unknown error in registry module", "", t.getMessage(), t);
             }
             try {
                 if (subscribeUrl != null) {
@@ -916,7 +916,7 @@ public class RegistryProtocol implements Protocol, ScopeModelAware {
                     }
                 }
             } catch (Throwable t) {
-                logger.warn(REGISTRY_UNEXPECTED_EXCEPTION, "", "", t.getMessage(), t);
+                logger.warn(INTERNAL_ERROR, "unknown error in registry module", "", t.getMessage(), t);
             }
 
             //TODO wait for shutdown timeout is a bit strange
@@ -928,7 +928,7 @@ public class RegistryProtocol implements Protocol, ScopeModelAware {
                 try {
                     exporter.unexport();
                 } catch (Throwable t) {
-                    logger.warn(REGISTRY_UNEXPECTED_EXCEPTION, "", "", t.getMessage(), t);
+                    logger.warn(INTERNAL_ERROR, "unknown error in registry module", "", t.getMessage(), t);
                 }
             }, timeout, TimeUnit.MILLISECONDS);
         }
diff --git a/dubbo-registry/dubbo-registry-api/src/main/java/org/apache/dubbo/registry/support/AbstractRegistry.java b/dubbo-registry/dubbo-registry-api/src/main/java/org/apache/dubbo/registry/support/AbstractRegistry.java
index 5749da821e..3a68a26433 100644
--- a/dubbo-registry/dubbo-registry-api/src/main/java/org/apache/dubbo/registry/support/AbstractRegistry.java
+++ b/dubbo-registry/dubbo-registry-api/src/main/java/org/apache/dubbo/registry/support/AbstractRegistry.java
@@ -66,7 +66,7 @@ import static org.apache.dubbo.common.constants.LoggerCodeConstants.REGISTRY_FAI
 import static org.apache.dubbo.common.constants.LoggerCodeConstants.REGISTRY_FAILED_DESTROY_UNREGISTER_URL;
 import static org.apache.dubbo.common.constants.LoggerCodeConstants.REGISTRY_FAILED_READ_WRITE_CACHE_FILE;
 import static org.apache.dubbo.common.constants.LoggerCodeConstants.REGISTRY_FAILED_DELETE_LOCKFILE;
-import static org.apache.dubbo.common.constants.LoggerCodeConstants.REGISTRY_UNEXPECTED_EXCEPTION;
+import static org.apache.dubbo.common.constants.LoggerCodeConstants.INTERNAL_ERROR;
 import static org.apache.dubbo.common.constants.RegistryConstants.ACCEPTS_KEY;
 import static org.apache.dubbo.common.constants.RegistryConstants.DEFAULT_CATEGORY;
 import static org.apache.dubbo.common.constants.RegistryConstants.DYNAMIC_KEY;
@@ -566,7 +566,7 @@ public abstract class AbstractRegistry implements Registry {
                 registryCacheExecutor.schedule(() -> doSaveProperties(version), DEFAULT_INTERVAL_SAVE_PROPERTIES, TimeUnit.MILLISECONDS);
             }
         } catch (Throwable t) {
-            logger.warn(REGISTRY_UNEXPECTED_EXCEPTION, "", "", t.getMessage(), t);
+            logger.warn(INTERNAL_ERROR, "unknown error in registry module", "", t.getMessage(), t);
         }
     }
 
diff --git a/dubbo-registry/dubbo-registry-api/src/main/java/org/apache/dubbo/registry/support/FailbackRegistry.java b/dubbo-registry/dubbo-registry-api/src/main/java/org/apache/dubbo/registry/support/FailbackRegistry.java
index fa906cf4ca..84613f74fe 100644
--- a/dubbo-registry/dubbo-registry-api/src/main/java/org/apache/dubbo/registry/support/FailbackRegistry.java
+++ b/dubbo-registry/dubbo-registry-api/src/main/java/org/apache/dubbo/registry/support/FailbackRegistry.java
@@ -37,7 +37,7 @@ import java.util.concurrent.ConcurrentMap;
 import java.util.concurrent.TimeUnit;
 
 import static org.apache.dubbo.common.constants.LoggerCodeConstants.REGISTRY_FAILED_NOTIFY_EVENT;
-import static org.apache.dubbo.common.constants.LoggerCodeConstants.REGISTRY_UNEXPECTED_EXCEPTION;
+import static org.apache.dubbo.common.constants.LoggerCodeConstants.INTERNAL_ERROR;
 import static org.apache.dubbo.registry.Constants.DEFAULT_REGISTRY_RETRY_PERIOD;
 import static org.apache.dubbo.registry.Constants.REGISTRY_RETRY_PERIOD_KEY;
 
@@ -219,7 +219,7 @@ public abstract class FailbackRegistry extends AbstractRegistry {
                 }
                 throw new IllegalStateException("Failed to register " + url + " to registry " + getUrl().getAddress() + ", cause: " + t.getMessage(), t);
             } else {
-                logger.error(REGISTRY_UNEXPECTED_EXCEPTION, "", "", "Failed to register " + url + ", waiting for retry, cause: " + t.getMessage(), t);
+                logger.error(INTERNAL_ERROR, "unknown error in registry module", "", "Failed to register " + url + ", waiting for retry, cause: " + t.getMessage(), t);
             }
 
             // Record a failed registration request to a failed list, retry regularly
@@ -268,7 +268,7 @@ public abstract class FailbackRegistry extends AbstractRegistry {
                 }
                 throw new IllegalStateException("Failed to unregister " + url + " to registry " + getUrl().getAddress() + ", cause: " + t.getMessage(), t);
             } else {
-                logger.error(REGISTRY_UNEXPECTED_EXCEPTION, "", "", "Failed to unregister " + url + ", waiting for retry, cause: " + t.getMessage(), t);
+                logger.error(INTERNAL_ERROR, "unknown error in registry module", "", "Failed to unregister " + url + ", waiting for retry, cause: " + t.getMessage(), t);
             }
 
             // Record a failed registration request to a failed list, retry regularly
diff --git a/dubbo-registry/dubbo-registry-api/src/main/java/org/apache/dubbo/registry/support/RegistryManager.java b/dubbo-registry/dubbo-registry-api/src/main/java/org/apache/dubbo/registry/support/RegistryManager.java
index 9d46730594..e01f3118ff 100644
--- a/dubbo-registry/dubbo-registry-api/src/main/java/org/apache/dubbo/registry/support/RegistryManager.java
+++ b/dubbo-registry/dubbo-registry-api/src/main/java/org/apache/dubbo/registry/support/RegistryManager.java
@@ -37,7 +37,7 @@ import java.util.concurrent.locks.ReentrantLock;
 import java.util.stream.Collectors;
 
 import static org.apache.dubbo.common.constants.LoggerCodeConstants.REGISTRY_FAILED_FETCH_INSTANCE;
-import static org.apache.dubbo.common.constants.LoggerCodeConstants.REGISTRY_UNEXPECTED_EXCEPTION;
+import static org.apache.dubbo.common.constants.LoggerCodeConstants.INTERNAL_ERROR;
 
 /**
  * Application Level, used to collect Registries
@@ -107,7 +107,7 @@ public class RegistryManager {
                 try {
                     registry.destroy();
                 } catch (Throwable e) {
-                    LOGGER.warn(REGISTRY_UNEXPECTED_EXCEPTION, "", "", e.getMessage(), e);
+                    LOGGER.warn(INTERNAL_ERROR, "unknown error in registry module", "", e.getMessage(), e);
                 }
             }
             registries.clear();