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

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

commit 0e4997b252027ec04037aa58609ece7c7d1236f3
Merge: 2a7dd3dc29 e86e6e3209
Author: Albumen Kevin <[email protected]>
AuthorDate: Thu Dec 29 17:33:02 2022 +0800

    Merge branch 'apache-3.1' into apache-3.2
    
    # Conflicts:
    #       
dubbo-common/src/main/java/org/apache/dubbo/common/constants/LoggerCodeConstants.java
    #       
dubbo-registry/dubbo-registry-api/src/main/java/org/apache/dubbo/registry/client/ServiceDiscoveryRegistry.java
    #       
dubbo-registry/dubbo-registry-api/src/main/java/org/apache/dubbo/registry/client/event/listener/ServiceInstancesChangedListener.java
    #       
dubbo-rpc/dubbo-rpc-api/src/main/resources/META-INF/dubbo/internal/org.apache.dubbo.rpc.Filter

 .github/workflows/build-and-test-pr.yml            |  6 ++-
 .github/workflows/build-and-test-scheduled-3.1.yml |  6 ++-
 .github/workflows/build-and-test-scheduled-3.2.yml |  6 ++-
 .github/workflows/release-test-3.1.yml             |  6 ++-
 .../wrapper/CompositeDynamicConfiguration.java     |  4 +-
 .../common/constants/LoggerCodeConstants.java      | 21 +++++++---
 .../dubbo/common/model/person/PersonMap.java       | 45 ++++++++++++++++++++++
 .../apache/dubbo/common/utils/PojoUtilsTest.java   | 12 +++++-
 .../apache/dubbo/config/spring/ReferenceBean.java  |  8 +++-
 .../metadata/store/nacos/NacosMetadataReport.java  |  2 +-
 .../dubbo/registry/ListenerRegistryWrapper.java    |  4 +-
 .../registry/client/ServiceDiscoveryRegistry.java  | 15 ++++----
 .../listener/ServiceInstancesChangedListener.java  | 14 +++----
 .../client/metadata/MetadataServiceDelegation.java |  6 +++
 .../metadata/MetadataServiceNameMapping.java       |  4 +-
 .../metadata/ProtocolPortsMetadataCustomizer.java  |  4 +-
 ...CloudServiceInstanceNotificationCustomizer.java |  3 +-
 .../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 +-
 .../zookeeper/ZookeeperServiceDiscovery.java       | 15 ++++++++
 .../dubbo/internal/org.apache.dubbo.rpc.Filter     |  1 +
 25 files changed, 161 insertions(+), 57 deletions(-)

diff --cc 
dubbo-common/src/main/java/org/apache/dubbo/common/constants/LoggerCodeConstants.java
index 84725c07dc,bd33f16ea4..35b9e27993
--- 
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
@@@ -75,11 -75,13 +75,15 @@@ public interface LoggerCodeConstants 
  
      String COMMON_METADATA_PROCESSOR = "0-26";
  
 +    String COMMON_ISOLATED_EXECUTOR_CONFIGURATION_ERROR = "0-27";
 +
-     // 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";
@@@ -201,7 -202,7 +208,7 @@@
  
      String CLUSTER_FAILED_GROUP_MERGE = "2-20";
  
-     // proxy module 3-1
 -    // Proxy module.
++    // Proxy module. 3-1
      String PROXY_FAILED_CONVERT_URL = "3-1";
  
      String PROXY_FAILED_EXPORT_SERVICE = "3-2";
@@@ -216,9 -217,7 +223,9 @@@
  
      String PROXY_TIMEOUT_RESPONSE = "3-7";
  
 +    String PROXY_FAILED = "3-8";
 +
-     // protocol module
+     // Protocol module.
      String PROTOCOL_UNSUPPORTED = "4-1";
  
      String PROTOCOL_FAILED_INIT_SERIALIZATION_OPTIMIZER = "4-2";
@@@ -386,9 -385,11 +393,13 @@@
  
      String QOS_UNEXPECTED_EXCEPTION = "7-6";
  
 +    String QOS_PERMISSION_DENY_EXCEPTION = "7-7";
 +
      // Internal unknown error.
+ 
+     /**
+      * Unknown internal error. (99-0)
+      */
      String INTERNAL_ERROR = "99-0";
  
      String INTERNAL_INTERRUPTED = "99-1";
diff --cc 
dubbo-registry/dubbo-registry-api/src/main/java/org/apache/dubbo/registry/client/ServiceDiscoveryRegistry.java
index 387452690b,6094cd969d..fa312813f7
--- 
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
@@@ -42,7 -42,6 +42,7 @@@ import static org.apache.dubbo.common.c
  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.INTERNAL_ERROR;
- 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;
@@@ -194,35 -193,31 +194,36 @@@ public class ServiceDiscoveryRegistry e
  
          boolean check = url.getParameter(CHECK_KEY, false);
  
 +        Set<String> mappingByUrl = ServiceNameMapping.getMappingByUrl(url);
 +
          String key = ServiceNameMapping.buildMappingKey(url);
 -        Lock mappingLock = serviceNameMapping.getMappingLock(key);
 -        try {
 -            mappingLock.lock();
 -            Set<String> subscribedServices = 
serviceNameMapping.getCachedMapping(url);
 +
-         if(mappingByUrl == null) {
++
++        if (mappingByUrl == null) {
 +            Lock mappingLock = serviceNameMapping.getMappingLock(key);
              try {
 -                MappingListener mappingListener = new 
DefaultMappingListener(url, subscribedServices, listener);
 -                subscribedServices = 
serviceNameMapping.getAndListen(this.getUrl(), url, mappingListener);
 -                mappingListeners.put(url.getProtocolServiceKey(), 
mappingListener);
 -            } catch (Exception e) {
 -                logger.warn(INTERNAL_ERROR, "unknown error in registry 
module", "", "Cannot find app mapping for service " + url.getServiceInterface() 
+ ", will not migrate.", e);
 -            }
 +                mappingLock.lock();
-                 Set<String> subscribedServices = 
serviceNameMapping.getMapping(url);
++                mappingByUrl = serviceNameMapping.getCachedMapping(url);
 +                try {
 +                    MappingListener mappingListener = new 
DefaultMappingListener(url, subscribedServices, listener);
 +                    mappingByUrl = 
serviceNameMapping.getAndListen(this.getUrl(), url, mappingListener);
 +                    mappingListeners.put(url.getProtocolServiceKey(), 
mappingListener);
 +                } catch (Exception e) {
 +                    logger.warn(INTERNAL_ERROR, "", "", "Cannot find app 
mapping for service " + url.getServiceInterface() + ", will not migrate.", e);
 +                }
  
 -            if (CollectionUtils.isEmpty(subscribedServices)) {
 -                logger.info("No interface-apps mapping found in local cache, 
stop subscribing, will automatically wait for mapping listener callback: " + 
url);
 +                if (CollectionUtils.isEmpty(mappingByUrl)) {
 +                    logger.info("No interface-apps mapping found in local 
cache, stop subscribing, will automatically wait for mapping listener callback: 
" + url);
-                     //                if (check) {
-                     //                    throw new 
IllegalStateException("Should has at least one way to know which services this 
interface belongs to, subscription url: " + url);
-                     //                }
+ //                if (check) {
+ //                    throw new IllegalStateException("Should has at least 
one way to know which services this interface belongs to, subscription url: " + 
url);
+ //                }
 -                return;
 +                    return;
 +                }
 +            } finally {
 +                mappingLock.unlock();
              }
 -
 -            subscribeURLs(url, listener, subscribedServices);
 -        } finally {
 -            mappingLock.unlock();
          }
 +        subscribeURLs(url, listener, mappingByUrl);
      }
  
      @Override
diff --cc 
dubbo-registry/dubbo-registry-api/src/main/java/org/apache/dubbo/registry/client/event/listener/ServiceInstancesChangedListener.java
index b4f9d73629,6196331538..f5f3ebac6d
--- 
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,8 -56,7 +56,8 @@@ import java.util.concurrent.atomic.Atom
  
  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.DEFAULT_ENABLE_EMPTY_PROTECTION;
  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;
diff --cc 
dubbo-rpc/dubbo-rpc-api/src/main/resources/META-INF/dubbo/internal/org.apache.dubbo.rpc.Filter
index 792fbe4f30,6f877fb7e9..dcc7bd45ec
--- 
a/dubbo-rpc/dubbo-rpc-api/src/main/resources/META-INF/dubbo/internal/org.apache.dubbo.rpc.Filter
+++ 
b/dubbo-rpc/dubbo-rpc-api/src/main/resources/META-INF/dubbo/internal/org.apache.dubbo.rpc.Filter
@@@ -13,4 -13,4 +13,5 @@@ compatible=org.apache.dubbo.rpc.filter.
  timeout=org.apache.dubbo.rpc.filter.TimeoutFilter
  tps=org.apache.dubbo.rpc.filter.TpsLimitFilter
  profiler-server=org.apache.dubbo.rpc.filter.ProfilerServerFilter
 +adaptiveLoadBalance=org.apache.dubbo.rpc.filter.AdaptiveLoadBalanceFilter
+ active-limit=org.apache.dubbo.rpc.filter.ActiveLimitFilter

Reply via email to