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 2023/09/11 09:16:36 UTC

[dubbo] branch 3.3 updated (8009c72030 -> 3ed2dacbef)

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

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


    from 8009c72030 Ignore class loading failure when native is compiled (#13009)
     add 025c078948 Check before init agg metrics (#12989)
     add 8d9817f8af Publish directory refresh event after connectivity check (#12988)
     add 0bfd54cea4 Cleanup and throw exception if bind failed (#12987)
     add bfa46f59eb Ignore start if scope model is LifeCycleManagedExternally (#12985)
     add e436f1eee9 Cleanup resoruce if qos start failed (#12993)
     add af566233db Support ignore refresh config (#12998)
     add 168b657807 fix SerializationException (#13000)
     add a4280b20a4 Bump com.alibaba.fastjson2:fastjson2 from 2.0.39 to 2.0.40 (#13005)
     add baec513773 Bump org.aspectj:aspectjweaver from 1.9.20 to 1.9.20.1 (#13006)
     add 60cbc4a5b6 Bump org.apache.thrift:libthrift from 0.18.1 to 0.19.0 (#13007)
     add 5bf698c368 Bump bytebuddy.version from 1.14.5 to 1.14.7 (#13004)
     add dc6d37aac1 Bump jetty_version from 9.4.51.v20230217 to 9.4.52.v20230823 (#13003)
     add 8595711e99 Bump org.eclipse.jetty:jetty-maven-plugin (#13002)
     add cdd7a40564 Fixes #12765 (#12981)
     add 35746aaf5a Fix rest protocol NPE when using apache-http-client (#12916) (#12984)
     add 843da6db6c Fix test cases in scheduled test (#13020)
     add fe7c8eedb5 Fix triple generic invoke (#13021)
     add 4c4bcb7a25 Support disable metrics init and sync (#13025)
     add 248449ada0 Add Javadoc of ErrorTypeAwareLogger. (#13032)
     add 286c87bc26 Prepare 3.2.6 release
     add 0ba35d3704 Bump to 3.2.7-SNAPSHOT
     add 89e279739b Prepare 3.2.6 release
     add 031da7b8ed Merge remote-tracking branch 'apache/3.2.6-release' into apache-3.2
     new 3ed2dacbef Merge branch 'apache-3.2' into apache-3.3

The 1 revisions listed above as "new" are entirely new to this
repository and will be described in separate emails.  The revisions
listed as "add" were already present in the repository and have only
been added to this reference.


Summary of changes:
 .../rpc/cluster/directory/AbstractDirectory.java   |  1 +
 .../dubbo/common/constants/CommonConstants.java    |  2 +-
 .../dubbo/common/constants/MetricsConstants.java   |  8 ++--
 .../dubbo/common/logger/ErrorTypeAwareLogger.java  | 15 +++++++
 .../org/apache/dubbo/config/AbstractConfig.java    | 36 ++++++++++++-----
 .../org/apache/dubbo/config/MetricsConfig.java     | 26 ++++++++++++
 .../org/apache/dubbo/config/ReferenceConfig.java   |  9 ++++-
 .../org/apache/dubbo/config/ServiceConfig.java     |  9 ++++-
 .../config/deploy/DefaultApplicationDeployer.java  |  1 +
 dubbo-config/dubbo-config-spring/pom.xml           |  2 +-
 .../apache/dubbo/config/spring/ReferenceBean.java  | 11 ++++-
 .../annotation/ServiceAnnotationPostProcessor.java |  2 +-
 .../context/DubboConfigApplicationListener.java    | 25 +++++++-----
 .../spring/reference/ReferenceBeanManager.java     |  2 +-
 .../META-INF/isolation/dubbo-provider.xml          |  2 +-
 dubbo-dependencies-bom/pom.xml                     |  6 +--
 .../collector/AggregateMetricsCollector.java       | 14 +++++--
 .../metrics/collector/DefaultMetricsCollector.java | 13 ++++++
 .../metrics/report/AbstractMetricsReporter.java    | 18 +++++----
 .../dubbo/qos/protocol/QosProtocolWrapper.java     | 12 ++++--
 .../apache/dubbo/qos/server/QosBindException.java  | 13 +++---
 .../java/org/apache/dubbo/qos/server/Server.java   | 20 +++++----
 .../java/org/apache/dubbo/remoting/Constants.java  |  4 ++
 .../http/restclient/HttpClientRestClient.java      |  3 +-
 .../netty4/NettyPortUnificationServer.java         | 47 +++++++++++++---------
 .../remoting/transport/netty4/NettyServer.java     | 29 ++++++++-----
 .../remoting/transport/netty4/ConnectionTest.java  |  6 +--
 .../netty4/PortUnificationServerTest.java          |  5 +--
 .../MultiplexProtocolConnectionManagerTest.java    |  7 ++--
 .../api/SingleProtocolConnectionManagerTest.java   |  3 +-
 .../rest/extension/resteasy/ResteasyContext.java   |  4 +-
 .../ResteasyRequestContainerFilterAdapter.java     |  5 +--
 .../ResteasyResponseContainerFilterAdapter.java    |  2 +-
 .../ResteasyWriterInterceptorAdapter.java          |  5 +--
 .../rest/filter/ServiceInvokeRestFilter.java       | 24 ++++++-----
 .../rest/filter/context/FilterContext.java         |  4 ++
 .../rest/filter/context/RestFilterContext.java     | 23 +++++++++++
 .../protocol/rest/handler/NettyHttpHandler.java    | 14 +++----
 .../rpc/protocol/rest/JaxrsRestProtocolTest.java   | 23 ++++++++++-
 ...ter.java => TraceRequestAndResponseFilter.java} | 10 +++--
 .../dubbo/rpc/protocol/tri/TripleInvoker.java      |  3 +-
 dubbo-spring-boot/pom.xml                          |  2 +-
 pom.xml                                            |  2 +-
 43 files changed, 325 insertions(+), 147 deletions(-)
 copy dubbo-demo/dubbo-demo-xml/dubbo-demo-xml-provider/src/main/java/org/apache/dubbo/demo/provider/GreetingServiceImpl.java => dubbo-plugin/dubbo-qos/src/main/java/org/apache/dubbo/qos/server/QosBindException.java (78%)
 copy dubbo-rpc/dubbo-rpc-rest/src/test/java/org/apache/dubbo/rpc/protocol/rest/filter/{TraceFilter.java => TraceRequestAndResponseFilter.java} (82%)


[dubbo] 01/01: Merge branch 'apache-3.2' into apache-3.3

Posted by al...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

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

commit 3ed2dacbef79dae8f13a3c50f5ffb39bfe386bbc
Merge: 8009c72030 031da7b8ed
Author: Albumen Kevin <jh...@gmail.com>
AuthorDate: Mon Sep 11 17:16:07 2023 +0800

    Merge branch 'apache-3.2' into apache-3.3
    
    # Conflicts:
    #       dubbo-common/src/main/java/org/apache/dubbo/common/constants/CommonConstants.java
    #       dubbo-common/src/main/java/org/apache/dubbo/config/MetricsConfig.java
    #       dubbo-config/dubbo-config-spring/src/main/java/org/apache/dubbo/config/spring/ReferenceBean.java
    #       dubbo-config/dubbo-config-spring/src/main/java/org/apache/dubbo/config/spring/beans/factory/annotation/ServiceAnnotationPostProcessor.java
    #       dubbo-dependencies-bom/pom.xml
    #       dubbo-dependencies/dubbo-dependencies-zookeeper-curator5/pom.xml
    #       dubbo-dependencies/dubbo-dependencies-zookeeper/pom.xml
    #       dubbo-metrics/dubbo-metrics-default/src/main/java/org/apache/dubbo/metrics/collector/DefaultMetricsCollector.java
    #       dubbo-remoting/dubbo-remoting-netty4/src/main/java/org/apache/dubbo/remoting/transport/netty4/NettyServer.java
    #       pom.xml

 .../rpc/cluster/directory/AbstractDirectory.java   |  1 +
 .../dubbo/common/constants/CommonConstants.java    |  2 +-
 .../dubbo/common/constants/MetricsConstants.java   |  8 ++--
 .../dubbo/common/logger/ErrorTypeAwareLogger.java  | 15 +++++++
 .../org/apache/dubbo/config/AbstractConfig.java    | 36 ++++++++++++-----
 .../org/apache/dubbo/config/MetricsConfig.java     | 26 ++++++++++++
 .../org/apache/dubbo/config/ReferenceConfig.java   |  9 ++++-
 .../org/apache/dubbo/config/ServiceConfig.java     |  9 ++++-
 .../config/deploy/DefaultApplicationDeployer.java  |  1 +
 dubbo-config/dubbo-config-spring/pom.xml           |  2 +-
 .../apache/dubbo/config/spring/ReferenceBean.java  | 11 ++++-
 .../annotation/ServiceAnnotationPostProcessor.java |  2 +-
 .../context/DubboConfigApplicationListener.java    | 25 +++++++-----
 .../spring/reference/ReferenceBeanManager.java     |  2 +-
 .../META-INF/isolation/dubbo-provider.xml          |  2 +-
 dubbo-dependencies-bom/pom.xml                     |  6 +--
 .../collector/AggregateMetricsCollector.java       | 14 +++++--
 .../metrics/collector/DefaultMetricsCollector.java | 13 ++++++
 .../metrics/report/AbstractMetricsReporter.java    | 18 +++++----
 .../dubbo/qos/protocol/QosProtocolWrapper.java     | 12 ++++--
 .../apache/dubbo/qos/server/QosBindException.java  | 28 ++++---------
 .../java/org/apache/dubbo/qos/server/Server.java   | 20 +++++----
 .../java/org/apache/dubbo/remoting/Constants.java  |  4 ++
 .../http/restclient/HttpClientRestClient.java      |  3 +-
 .../netty4/NettyPortUnificationServer.java         | 47 +++++++++++++---------
 .../remoting/transport/netty4/NettyServer.java     | 29 ++++++++-----
 .../remoting/transport/netty4/ConnectionTest.java  |  6 +--
 .../netty4/PortUnificationServerTest.java          |  5 +--
 .../MultiplexProtocolConnectionManagerTest.java    |  7 ++--
 .../api/SingleProtocolConnectionManagerTest.java   |  3 +-
 .../rest/extension/resteasy/ResteasyContext.java   |  4 +-
 .../ResteasyRequestContainerFilterAdapter.java     |  5 +--
 .../ResteasyResponseContainerFilterAdapter.java    |  2 +-
 .../ResteasyWriterInterceptorAdapter.java          |  5 +--
 .../rest/filter/ServiceInvokeRestFilter.java       | 24 ++++++-----
 .../rest/filter/context/FilterContext.java         |  4 ++
 .../rest/filter/context/RestFilterContext.java     | 23 +++++++++++
 .../protocol/rest/handler/NettyHttpHandler.java    | 14 +++----
 .../rpc/protocol/rest/JaxrsRestProtocolTest.java   | 23 ++++++++++-
 .../rest/filter/TraceRequestAndResponseFilter.java | 47 ++++++++++++++++++++++
 .../dubbo/rpc/protocol/tri/TripleInvoker.java      |  3 +-
 dubbo-spring-boot/pom.xml                          |  2 +-
 pom.xml                                            |  2 +-
 43 files changed, 369 insertions(+), 155 deletions(-)

diff --cc dubbo-common/src/main/java/org/apache/dubbo/common/constants/CommonConstants.java
index 3380621774,03b93bbce3..c3aea739ee
--- a/dubbo-common/src/main/java/org/apache/dubbo/common/constants/CommonConstants.java
+++ b/dubbo-common/src/main/java/org/apache/dubbo/common/constants/CommonConstants.java
@@@ -639,11 -643,5 +639,11 @@@ public interface CommonConstants 
  
      String DUBBO_PACKABLE_METHOD_FACTORY = "dubbo.application.parameters." + PACKABLE_METHOD_FACTORY_KEY;
  
 +    String DUBBO_TAG_HEADER = "dubbo-tag";
 +
 +    String REST_SERVICE_DEPLOYER_URL_ATTRIBUTE_KEY = "restServiceDeployerAttributeKey";
 +
-     String SERVICE_DEPLOYER_ATTRIBUTE_KEY = "serviceDeployer";    String RESTEASY_NETTY_HTTP_REQUEST_ATTRIBUTE_KEY = "resteasyNettyHttpRequest";
++    String SERVICE_DEPLOYER_ATTRIBUTE_KEY = "serviceDeployer";
 +
      String DUBBO_MANUAL_REGISTER_KEY = "dubbo.application.manual-register";
  }
diff --cc dubbo-common/src/main/java/org/apache/dubbo/common/constants/MetricsConstants.java
index 49bd9665c7,4c4437d427..53e377f9f9
--- a/dubbo-common/src/main/java/org/apache/dubbo/common/constants/MetricsConstants.java
+++ b/dubbo-common/src/main/java/org/apache/dubbo/common/constants/MetricsConstants.java
@@@ -40,17 -40,17 +40,19 @@@ public interface MetricsConstants 
      String TAG_VERSION_KEY = "version";
  
      String TAG_APPLICATION_VERSION_KEY = "application.version";
-     
+ 
      String TAG_KEY_KEY = "key";
-     
+ 
      String TAG_CONFIG_CENTER = "config.center";
-     
+ 
      String TAG_CHANGE_TYPE = "change.type";
  
 +    String TAG_ERROR_CODE = "error";
 +
      String ENABLE_JVM_METRICS_KEY = "enable.jvm";
  
+     String ENABLE_COLLECTOR_SYNC_KEY = "enable.collector.sync";
+ 
      String AGGREGATION_COLLECTOR_KEY = "aggregation";
  
      String AGGREGATION_ENABLED_KEY = "aggregation.enabled";
diff --cc dubbo-common/src/main/java/org/apache/dubbo/config/MetricsConfig.java
index 37cd727f4c,129391af72..3faa74f012
--- a/dubbo-common/src/main/java/org/apache/dubbo/config/MetricsConfig.java
+++ b/dubbo-common/src/main/java/org/apache/dubbo/config/MetricsConfig.java
@@@ -61,11 -61,16 +61,21 @@@ public class MetricsConfig extends Abst
       */
      private Boolean exportMetricsService;
  
 +    /**
 +     * Enable netty metrics.
 +     */
 +    private Boolean enableNetty;
 +
+     /**
+      * Enable metrics init.
+      */
+     private Boolean enableMetricsInit;
+ 
+     /**
+      * Enable collector sync.
+      */
+     private Boolean enableCollectorSync;
+ 
      /**
       * @deprecated After metrics config is refactored.
       * This parameter should no longer use and will be deleted in the future.
diff --cc dubbo-config/dubbo-config-spring/src/main/java/org/apache/dubbo/config/spring/ReferenceBean.java
index edad8afd0e,30790d3fd8..28d0ef0973
--- a/dubbo-config/dubbo-config-spring/src/main/java/org/apache/dubbo/config/spring/ReferenceBean.java
+++ b/dubbo-config/dubbo-config-spring/src/main/java/org/apache/dubbo/config/spring/ReferenceBean.java
@@@ -24,7 -24,7 +24,8 @@@ import org.apache.dubbo.common.utils.As
  import org.apache.dubbo.common.utils.ClassUtils;
  import org.apache.dubbo.common.utils.StringUtils;
  import org.apache.dubbo.config.ReferenceConfig;
 +import org.apache.dubbo.config.spring.aot.AotWithSpringDetector;
+ import org.apache.dubbo.config.spring.context.DubboConfigApplicationListener;
  import org.apache.dubbo.config.spring.context.DubboConfigBeanInitializer;
  import org.apache.dubbo.config.spring.reference.ReferenceAttributes;
  import org.apache.dubbo.config.spring.reference.ReferenceBeanManager;
@@@ -143,8 -145,11 +145,11 @@@ public class ReferenceBean<T> implement
      //actual reference config
      private ReferenceConfig referenceConfig;
  
+     // ReferenceBeanManager
+     private ReferenceBeanManager referenceBeanManager;
+ 
      // Registration sources of this reference, may be xml file or annotation location
 -    private List<Map<String,Object>> sources = new ArrayList<>();
 +    private List<Map<String, Object>> sources = new ArrayList<>();
  
      public ReferenceBean() {
          super();
diff --cc dubbo-config/dubbo-config-spring/src/main/java/org/apache/dubbo/config/spring/beans/factory/annotation/ServiceAnnotationPostProcessor.java
index 43f1ae5a19,279e1c1903..87f1e74f1f
--- a/dubbo-config/dubbo-config-spring/src/main/java/org/apache/dubbo/config/spring/beans/factory/annotation/ServiceAnnotationPostProcessor.java
+++ b/dubbo-config/dubbo-config-spring/src/main/java/org/apache/dubbo/config/spring/beans/factory/annotation/ServiceAnnotationPostProcessor.java
@@@ -238,8 -239,8 +238,8 @@@ public class ServiceAnnotationPostProce
                  }
              } else {
                  if (logger.isWarnEnabled()) {
-                     logger.warn(CONFIG_NO_ANNOTATIONS_FOUND, "No annotations were found on the class", "", "No class annotated by Dubbo @Service was found under package ["
 -                    logger.warn(CONFIG_NO_ANNOTATIONS_FOUND,"No annotations were found on the class","","No class annotated by Dubbo @DubboService or @Service was found under package ["
 -                            + packageToScan + "], ignore re-scanned classes: " + scanExcludeFilter.getExcludedCount());
++                    logger.warn(CONFIG_NO_ANNOTATIONS_FOUND, "No annotations were found on the class", "", "No class annotated by Dubbo @DubboService or @Service was found under package ["
 +                        + packageToScan + "], ignore re-scanned classes: " + scanExcludeFilter.getExcludedCount());
                  }
              }
  
diff --cc dubbo-metrics/dubbo-metrics-default/src/main/java/org/apache/dubbo/metrics/collector/DefaultMetricsCollector.java
index 65f40b5185,9d04633260..7f2d502a86
--- a/dubbo-metrics/dubbo-metrics-default/src/main/java/org/apache/dubbo/metrics/collector/DefaultMetricsCollector.java
+++ b/dubbo-metrics/dubbo-metrics-default/src/main/java/org/apache/dubbo/metrics/collector/DefaultMetricsCollector.java
@@@ -62,14 -61,11 +62,16 @@@ public class DefaultMetricsCollector ex
  
      private volatile boolean threadpoolCollectEnabled = false;
  
+     private volatile boolean metricsInitEnabled = true;
+ 
      private final ThreadPoolMetricsSampler threadPoolSampler = new ThreadPoolMetricsSampler(this);
 +
 +    private final ErrorCodeSampler errorCodeSampler;
 +
      private String applicationName;
 +
      private final ApplicationModel applicationModel;
 +
      private final List<MetricsSampler> samplers = new ArrayList<>();
  
      private final List<MetricsCollector> collectors = new ArrayList<>();
diff --cc dubbo-remoting/dubbo-remoting-netty4/src/main/java/org/apache/dubbo/remoting/transport/netty4/NettyServer.java
index 6acf226391,1c0c7da3a9..d165651858
--- a/dubbo-remoting/dubbo-remoting-netty4/src/main/java/org/apache/dubbo/remoting/transport/netty4/NettyServer.java
+++ b/dubbo-remoting/dubbo-remoting-netty4/src/main/java/org/apache/dubbo/remoting/transport/netty4/NettyServer.java
@@@ -111,30 -105,14 +111,35 @@@ public class NettyServer extends Abstra
          initServerBootstrap(nettyServerHandler);
  
          // bind
-         ChannelFuture channelFuture = bootstrap.bind(getBindAddress());
-         channelFuture.syncUninterruptibly();
-         channel = channelFuture.channel();
+         try {
+             ChannelFuture channelFuture = bootstrap.bind(getBindAddress());
+             channelFuture.syncUninterruptibly();
+             channel = channelFuture.channel();
+         } catch (Throwable t) {
+             closeBootstrap();
+             throw t;
+         }
 +
 +        // metrics
 +        if (isSupportMetrics()) {
 +            ApplicationModel applicationModel = ApplicationModel.defaultModel();
 +            MetricsEventBus.post(NettyEvent.toNettyEvent(applicationModel), () -> {
 +                Map<String, Long> dataMap = new HashMap<>();
 +                dataMap.put(MetricsKey.NETTY_ALLOCATOR_HEAP_MEMORY_USED.getName(), PooledByteBufAllocator.DEFAULT.metric().usedHeapMemory());
 +                dataMap.put(MetricsKey.NETTY_ALLOCATOR_DIRECT_MEMORY_USED.getName(), PooledByteBufAllocator.DEFAULT.metric().usedDirectMemory());
 +                dataMap.put(MetricsKey.NETTY_ALLOCATOR_HEAP_ARENAS_NUM.getName(), (long) PooledByteBufAllocator.DEFAULT.numHeapArenas());
 +                dataMap.put(MetricsKey.NETTY_ALLOCATOR_DIRECT_ARENAS_NUM.getName(), (long) PooledByteBufAllocator.DEFAULT.numDirectArenas());
 +                dataMap.put(MetricsKey.NETTY_ALLOCATOR_NORMAL_CACHE_SIZE.getName(), (long) PooledByteBufAllocator.DEFAULT.normalCacheSize());
 +                dataMap.put(MetricsKey.NETTY_ALLOCATOR_SMALL_CACHE_SIZE.getName(), (long) PooledByteBufAllocator.DEFAULT.smallCacheSize());
 +                dataMap.put(MetricsKey.NETTY_ALLOCATOR_THREAD_LOCAL_CACHES_NUM.getName(), (long) PooledByteBufAllocator.DEFAULT.numThreadLocalCaches());
 +                dataMap.put(MetricsKey.NETTY_ALLOCATOR_CHUNK_SIZE.getName(), (long) PooledByteBufAllocator.DEFAULT.chunkSize());
 +                return dataMap;
 +            });
 +        }
 +    }
 +
 +    private boolean isSupportMetrics() {
 +        return ClassUtils.isPresent("io.netty.buffer.PooledByteBufAllocatorMetric", NettyServer.class.getClassLoader());
      }
  
      protected EventLoopGroup createBossGroup() {