From fed4755cd6693e51d8f99555b1d339019e591917 Mon Sep 17 00:00:00 2001 From: namelessssssssssss <100946116+namelessssssssssss@users.noreply.github.com> Date: Tue, 2 Jan 2024 10:22:13 +0800 Subject: [PATCH 01/40] Fix dubbo.tag override by consumer.tag in NacosRegistry (#13592) --- .../support/CacheableFailbackRegistry.java | 16 ---------------- .../dubbo/registry/support/FailbackRegistry.java | 15 +++++++++++++++ .../dubbo/registry/nacos/NacosRegistry.java | 1 + 3 files changed, 16 insertions(+), 16 deletions(-) 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 94b38c6224e..41b2c3ac4b4 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 @@ -32,7 +32,6 @@ import org.apache.dubbo.common.utils.StringUtils; import org.apache.dubbo.common.utils.UrlUtils; import org.apache.dubbo.registry.NotifyListener; -import org.apache.dubbo.registry.ProviderFirstParams; import org.apache.dubbo.rpc.model.ScopeModel; import java.util.ArrayList; @@ -41,7 +40,6 @@ 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.ConcurrentMap; import java.util.concurrent.ScheduledExecutorService; @@ -319,20 +317,6 @@ protected ServiceAddressURL createServiceURL(URLAddress address, URLParam param, return new DubboServiceAddressURL(address, param, consumerURL, null); } - protected URL removeParamsFromConsumer(URL consumer) { - Set providerFirstParams = consumer.getOrDefaultApplicationModel() - .getExtensionLoader(ProviderFirstParams.class) - .getSupportedExtensionInstances(); - if (CollectionUtils.isEmpty(providerFirstParams)) { - return consumer; - } - - for (ProviderFirstParams paramsFilter : providerFirstParams) { - consumer = consumer.removeParameters(paramsFilter.params()); - } - return consumer; - } - private String stripOffVariableKeys(String rawProvider) { String[] keys = getVariableKeys(); if (keys == null || keys.length == 0) { 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 5d311ca17d8..177332240c2 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 @@ -21,6 +21,7 @@ import org.apache.dubbo.common.utils.CollectionUtils; import org.apache.dubbo.common.utils.NamedThreadFactory; import org.apache.dubbo.registry.NotifyListener; +import org.apache.dubbo.registry.ProviderFirstParams; import org.apache.dubbo.registry.retry.FailedRegisteredTask; import org.apache.dubbo.registry.retry.FailedSubscribedTask; import org.apache.dubbo.registry.retry.FailedUnregisteredTask; @@ -177,6 +178,20 @@ private void removeFailedUnsubscribed(URL url, NotifyListener listener) { } } + protected URL removeParamsFromConsumer(URL consumer) { + Set providerFirstParams = consumer.getOrDefaultApplicationModel() + .getExtensionLoader(ProviderFirstParams.class) + .getSupportedExtensionInstances(); + if (CollectionUtils.isEmpty(providerFirstParams)) { + return consumer; + } + + for (ProviderFirstParams paramsFilter : providerFirstParams) { + consumer = consumer.removeParameters(paramsFilter.params()); + } + return consumer; + } + ConcurrentMap getFailedRegistered() { return failedRegistered; } diff --git a/dubbo-registry/dubbo-registry-nacos/src/main/java/org/apache/dubbo/registry/nacos/NacosRegistry.java b/dubbo-registry/dubbo-registry-nacos/src/main/java/org/apache/dubbo/registry/nacos/NacosRegistry.java index de2d990ac43..9fbbd9ebb4e 100644 --- a/dubbo-registry/dubbo-registry-nacos/src/main/java/org/apache/dubbo/registry/nacos/NacosRegistry.java +++ b/dubbo-registry/dubbo-registry-nacos/src/main/java/org/apache/dubbo/registry/nacos/NacosRegistry.java @@ -573,6 +573,7 @@ public void destroy() { } private List toUrlWithEmpty(URL consumerURL, Collection instances) { + consumerURL = removeParamsFromConsumer(consumerURL); List urls = buildURLs(consumerURL, instances); // Nacos does not support configurators and routers from registry, so all notifications are of providers type. if (urls.size() == 0 && !getUrl().getParameter(ENABLE_EMPTY_PROTECTION_KEY, DEFAULT_ENABLE_EMPTY_PROTECTION)) { From 50c5a668c79d4cde82602510b36d1073c37e6035 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Tue, 2 Jan 2024 10:28:27 +0800 Subject: [PATCH 02/40] Bump log4j2_version from 2.22.0 to 2.22.1 (#13594) Bumps `log4j2_version` from 2.22.0 to 2.22.1. Updates `org.apache.logging.log4j:log4j-api` from 2.22.0 to 2.22.1 Updates `org.apache.logging.log4j:log4j-core` from 2.22.0 to 2.22.1 --- updated-dependencies: - dependency-name: org.apache.logging.log4j:log4j-api dependency-type: direct:production update-type: version-update:semver-patch - dependency-name: org.apache.logging.log4j:log4j-core dependency-type: direct:production update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- dubbo-dependencies-bom/pom.xml | 2 +- dubbo-spring-boot/pom.xml | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/dubbo-dependencies-bom/pom.xml b/dubbo-dependencies-bom/pom.xml index 3a6a72d605f..4e098f38da7 100644 --- a/dubbo-dependencies-bom/pom.xml +++ b/dubbo-dependencies-bom/pom.xml @@ -143,7 +143,7 @@ 1.2.17 1.2.13 - 2.22.0 + 2.22.1 2.15.1 0.13.0 diff --git a/dubbo-spring-boot/pom.xml b/dubbo-spring-boot/pom.xml index d498ddb96cd..ca381b59921 100644 --- a/dubbo-spring-boot/pom.xml +++ b/dubbo-spring-boot/pom.xml @@ -41,7 +41,7 @@ 2.7.18 ${revision} - 2.22.0 + 2.22.1 1.14.11 From 011d6e0a718280433aeb2e777366e55b20a51cfe Mon Sep 17 00:00:00 2001 From: Albumen Kevin Date: Tue, 2 Jan 2024 16:47:08 +0800 Subject: [PATCH 03/40] Exclude `UseJavaPackageAsPath` to parameters (#13595) --- .../java/org/apache/dubbo/config/AbstractServiceConfig.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/dubbo-common/src/main/java/org/apache/dubbo/config/AbstractServiceConfig.java b/dubbo-common/src/main/java/org/apache/dubbo/config/AbstractServiceConfig.java index c1bfe1c59ba..9750d69b1c9 100644 --- a/dubbo-common/src/main/java/org/apache/dubbo/config/AbstractServiceConfig.java +++ b/dubbo-common/src/main/java/org/apache/dubbo/config/AbstractServiceConfig.java @@ -397,11 +397,11 @@ public void setPayload(Integer payload) { this.payload = payload; } + @Parameter(excluded = true, attribute = false) public Boolean getUseJavaPackageAsPath() { return useJavaPackageAsPath; } - @Parameter(excluded = true) public void setUseJavaPackageAsPath(Boolean useJavaPackageAsPath) { this.useJavaPackageAsPath = useJavaPackageAsPath; } From 06d29f12ea2c4648188a433f524041e5c64a1cee Mon Sep 17 00:00:00 2001 From: Albumen Kevin Date: Tue, 2 Jan 2024 18:50:56 +0800 Subject: [PATCH 04/40] Update NOTICE to 2024 --- NOTICE | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/NOTICE b/NOTICE index fb9cb501418..f4a3a7b8642 100644 --- a/NOTICE +++ b/NOTICE @@ -1,5 +1,5 @@ Apache Dubbo -Copyright 2018-2023 The Apache Software Foundation +Copyright 2018-2024 The Apache Software Foundation This product includes software developed at The Apache Software Foundation (http://www.apache.org/). From 1bdbfd864740f6023762b788c7ae0d42f00fd5d6 Mon Sep 17 00:00:00 2001 From: namelessssssssssss <100946116+namelessssssssssss@users.noreply.github.com> Date: Tue, 2 Jan 2024 18:58:43 +0800 Subject: [PATCH 05/40] Fix MergeableClusterInvoker log issue (#13593) * Fix MergeableClusterInvoker log issue * Code style fix * Update log level * Update log level * Update log level * Add exception stacktrace --- .../support/MergeableClusterInvoker.java | 23 ++++++++++++++++--- 1 file changed, 20 insertions(+), 3 deletions(-) diff --git a/dubbo-cluster/src/main/java/org/apache/dubbo/rpc/cluster/support/MergeableClusterInvoker.java b/dubbo-cluster/src/main/java/org/apache/dubbo/rpc/cluster/support/MergeableClusterInvoker.java index e7c5f9d781b..e15f76d08dd 100644 --- a/dubbo-cluster/src/main/java/org/apache/dubbo/rpc/cluster/support/MergeableClusterInvoker.java +++ b/dubbo-cluster/src/main/java/org/apache/dubbo/rpc/cluster/support/MergeableClusterInvoker.java @@ -16,6 +16,7 @@ */ package org.apache.dubbo.rpc.cluster.support; +import org.apache.dubbo.common.constants.LoggerCodeConstants; import org.apache.dubbo.common.logger.ErrorTypeAwareLogger; import org.apache.dubbo.common.logger.LoggerFactory; import org.apache.dubbo.common.utils.ConfigUtils; @@ -69,8 +70,10 @@ protected Result doInvoke(Invocation invocation, List> invokers, Load return invokeWithContext(invoker, invocation); } catch (RpcException e) { if (e.isNoInvokerAvailableAfterFilter()) { - log.debug("No available provider for service" + getUrl().getServiceKey() + " on group " - + invoker.getUrl().getGroup() + ", will continue to try another group."); + log.debug( + "No available provider for service" + getUrl().getServiceKey() + " on group " + + invoker.getUrl().getGroup() + ", will continue to try another group.", + e); } else { throw e; } @@ -93,7 +96,21 @@ protected Result doInvoke(Invocation invocation, List> invokers, Load for (final Invoker invoker : invokers) { RpcInvocation subInvocation = new RpcInvocation(invocation, invoker); subInvocation.setAttachment(ASYNC_KEY, "true"); - results.put(invoker.getUrl().getServiceKey(), invokeWithContext(invoker, subInvocation)); + try { + results.put(invoker.getUrl().getServiceKey(), invokeWithContext(invoker, subInvocation)); + } catch (RpcException e) { + if (e.isNoInvokerAvailableAfterFilter()) { + log.warn( + LoggerCodeConstants.CLUSTER_NO_VALID_PROVIDER, + e.getCause().getMessage(), + "", + "No available provider for service" + getUrl().getServiceKey() + " on group " + + invoker.getUrl().getGroup() + ", will continue to try another group.", + e); + } else { + throw e; + } + } } Object result; From e583187aac96760860af5d67c965d3391ff2ff4d Mon Sep 17 00:00:00 2001 From: namelessssssssssss <100946116+namelessssssssssss@users.noreply.github.com> Date: Thu, 4 Jan 2024 20:01:38 +0800 Subject: [PATCH 06/40] Fix triple injvm deep copy issue (#13597) --- .../dubbo/rpc/protocol/injvm/DefaultParamDeepCopyUtil.java | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/dubbo-rpc/dubbo-rpc-injvm/src/main/java/org/apache/dubbo/rpc/protocol/injvm/DefaultParamDeepCopyUtil.java b/dubbo-rpc/dubbo-rpc-injvm/src/main/java/org/apache/dubbo/rpc/protocol/injvm/DefaultParamDeepCopyUtil.java index 4f5243e6557..fc365668aaa 100644 --- a/dubbo-rpc/dubbo-rpc-injvm/src/main/java/org/apache/dubbo/rpc/protocol/injvm/DefaultParamDeepCopyUtil.java +++ b/dubbo-rpc/dubbo-rpc-injvm/src/main/java/org/apache/dubbo/rpc/protocol/injvm/DefaultParamDeepCopyUtil.java @@ -22,6 +22,7 @@ import org.apache.dubbo.common.serialize.ObjectInput; import org.apache.dubbo.common.serialize.ObjectOutput; import org.apache.dubbo.common.serialize.Serialization; +import org.apache.dubbo.common.utils.ProtobufUtils; import org.apache.dubbo.remoting.utils.UrlUtils; import java.io.ByteArrayInputStream; @@ -40,6 +41,10 @@ public class DefaultParamDeepCopyUtil implements ParamDeepCopyUtil { @Override @SuppressWarnings({"unchecked"}) public T copy(URL url, Object src, Class targetClass, Type type) { + // TODO: maybe we have better way to do this + if (src != null && ProtobufUtils.isProtobufClass(src.getClass())) { + return (T) src; + } Serialization serialization = url.getOrDefaultFrameworkModel() .getExtensionLoader(Serialization.class) .getExtension(UrlUtils.serializationOrDefault(url)); From 26eac846b99b53e2caf744ef931b9dd9666bf052 Mon Sep 17 00:00:00 2001 From: Sean Yang Date: Sun, 7 Jan 2024 20:27:41 +0800 Subject: [PATCH 07/40] style(editorconfig): Maintain the source code format and spotless plugin format the same as much as possible through editorconfig (#13622) --- .editorconfig | 52 ++++++++++++++++++++++++++++++++++++++++++++++----- 1 file changed, 47 insertions(+), 5 deletions(-) diff --git a/.editorconfig b/.editorconfig index eefafba37cc..5de62e0893b 100644 --- a/.editorconfig +++ b/.editorconfig @@ -19,13 +19,55 @@ # top-most EditorConfig file root = true -# Unix-style newlines with a newline ending every file [*] charset = utf-8 end_of_line = lf +indent_size = 4 +indent_style = space +tab_width = 4 +max_line_length = 120 insert_final_newline = true +trim_trailing_whitespace = true -# 4 space indentation -[*.{java,xml}] -indent_style = space -indent_size = 4 +[*.java] +ij_java_continuation_indent_size = 8 +ij_java_keep_control_statement_in_one_line = false +ij_java_for_brace_force = always +ij_java_if_brace_force = always +ij_java_keep_first_column_comment = false +ij_java_keep_line_breaks = false +ij_java_keep_simple_blocks_in_one_line = true +ij_java_keep_simple_classes_in_one_line = true +ij_java_keep_simple_lambdas_in_one_line = true +ij_java_keep_simple_methods_in_one_line = true +ij_java_keep_blank_lines_in_code = 1 +ij_java_keep_blank_lines_in_declarations = 1 +ij_java_class_count_to_use_import_on_demand = 999 +ij_java_names_count_to_use_import_on_demand = 999 +ij_java_imports_layout = org.apache.dubbo.**, |, javax.**, |, java.**, |, *, |, $* +ij_java_insert_inner_class_imports = true +ij_java_space_before_array_initializer_left_brace = true +ij_java_method_parameters_new_line_after_left_paren = true +ij_java_wrap_comments = true +ij_java_wrap_long_lines = true +ij_java_enum_constants_wrap = split_into_lines +ij_java_method_call_chain_wrap = split_into_lines +ij_java_method_parameters_wrap = on_every_item +ij_java_extends_list_wrap = on_every_item +ij_java_extends_keyword_wrap = normal +ij_java_binary_operation_wrap = normal +ij_java_binary_operation_sign_on_next_line = true + +[*.json] +tab_width = 2 + +[*.{yml,yaml}] +indent_size = 2 + +[*.xml] +ij_xml_attribute_wrap = off +ij_xml_text_wrap = off +ij_xml_keep_blank_lines = 1 + +[pom.xml] +indent_size = 2 From 1c6374c2f564766dbeacd6866c7ccb84b2690a2a Mon Sep 17 00:00:00 2001 From: huazhongming Date: Mon, 8 Jan 2024 19:50:50 +0800 Subject: [PATCH 08/40] Update SECURITY.md --- SECURITY.md | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/SECURITY.md b/SECURITY.md index 981019e4773..815a736ead2 100644 --- a/SECURITY.md +++ b/SECURITY.md @@ -5,13 +5,15 @@ Below is a table that shows versions that we accept security fixes. | Version | Supported | -| ------- | ------------------ | -| 3.0.x | :white_check_mark: | -| 2.7.x | :white_check_mark: | -| 2.6.x | :white_check_mark: | +|---------| ------------------ | +| 3.3.x | :white_check_mark: | +| 3.2.x | :white_check_mark: | +| 3.1.x | :white_check_mark: | +| 3.0.x | :x: | +| 2.7.x | :x: | +| 2.6.x | :x: | | 2.5.x | :x: | - ## Reporting a Vulnerability The Apache Software Foundation takes a rigorous standpoint in annihilating the security issues in its software projects. Apache Dubbo is highly sensitive and forthcoming to issues pertaining to its features and functionality. From bada1b831c2ff13a35efca062d488304a4e7d72f Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 8 Jan 2024 20:33:43 +0800 Subject: [PATCH 09/40] Bump io.zipkin.reporter2:zipkin-reporter-bom from 2.17.1 to 2.17.2 (#13626) Bumps [io.zipkin.reporter2:zipkin-reporter-bom](https://github.com/openzipkin/zipkin-reporter-java) from 2.17.1 to 2.17.2. - [Release notes](https://github.com/openzipkin/zipkin-reporter-java/releases) - [Changelog](https://github.com/openzipkin/zipkin-reporter-java/blob/master/RELEASE.md) - [Commits](https://github.com/openzipkin/zipkin-reporter-java/compare/2.17.1...2.17.2) --- updated-dependencies: - dependency-name: io.zipkin.reporter2:zipkin-reporter-bom dependency-type: direct:production update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- .../dubbo-spring-boot-starters/observability/pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/dubbo-spring-boot/dubbo-spring-boot-starters/observability/pom.xml b/dubbo-spring-boot/dubbo-spring-boot-starters/observability/pom.xml index 86136b8d788..17e867dc4b5 100644 --- a/dubbo-spring-boot/dubbo-spring-boot-starters/observability/pom.xml +++ b/dubbo-spring-boot/dubbo-spring-boot-starters/observability/pom.xml @@ -39,7 +39,7 @@ 1.12.1 1.2.1 1.33.0 - 2.17.1 + 2.17.2 0.16.0 From 9f50c97ca7d798ace0e867c367c806721afbfe47 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 8 Jan 2024 20:36:58 +0800 Subject: [PATCH 10/40] Bump org.apache.commons:commons-exec from 1.3 to 1.4.0 (#13625) Bumps org.apache.commons:commons-exec from 1.3 to 1.4.0. --- updated-dependencies: - dependency-name: org.apache.commons:commons-exec dependency-type: direct:production update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- dubbo-test/dubbo-test-check/pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/dubbo-test/dubbo-test-check/pom.xml b/dubbo-test/dubbo-test-check/pom.xml index 89cfc8f8213..d6ec5d7e55d 100644 --- a/dubbo-test/dubbo-test-check/pom.xml +++ b/dubbo-test/dubbo-test-check/pom.xml @@ -35,7 +35,7 @@ 4.2.0 1.25.0 1.9.3 - 1.3 + 1.4.0 2.12.3 From ec47f807b97cfad5b958f669d8e00ebe9966e46c Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 8 Jan 2024 20:38:24 +0800 Subject: [PATCH 11/40] Bump com.alibaba.fastjson2:fastjson2 from 2.0.44 to 2.0.45 (#13627) Bumps [com.alibaba.fastjson2:fastjson2](https://github.com/alibaba/fastjson2) from 2.0.44 to 2.0.45. - [Release notes](https://github.com/alibaba/fastjson2/releases) - [Commits](https://github.com/alibaba/fastjson2/compare/2.0.44...2.0.45) --- updated-dependencies: - dependency-name: com.alibaba.fastjson2:fastjson2 dependency-type: direct:production update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- dubbo-dependencies-bom/pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/dubbo-dependencies-bom/pom.xml b/dubbo-dependencies-bom/pom.xml index 4e098f38da7..21c48a7c51e 100644 --- a/dubbo-dependencies-bom/pom.xml +++ b/dubbo-dependencies-bom/pom.xml @@ -99,7 +99,7 @@ 4.5.14 4.4.16 1.2.83 - 2.0.44 + 2.0.45 3.7.0 5.1.0 2.12.0 From 670f997eac5bc0727628762f59cd30417e0f6c58 Mon Sep 17 00:00:00 2001 From: CycleMaker <133181918+CycleMaker@users.noreply.github.com> Date: Mon, 8 Jan 2024 20:40:08 +0800 Subject: [PATCH 12/40] fix AbortPolicyWithReport Semaphore lock not released (#13609) Co-authored-by: wuzihan --- .../support/AbortPolicyWithReport.java | 18 ++++++++++-------- 1 file changed, 10 insertions(+), 8 deletions(-) diff --git a/dubbo-common/src/main/java/org/apache/dubbo/common/threadpool/support/AbortPolicyWithReport.java b/dubbo-common/src/main/java/org/apache/dubbo/common/threadpool/support/AbortPolicyWithReport.java index 223a72419de..1f2e82e77ea 100644 --- a/dubbo-common/src/main/java/org/apache/dubbo/common/threadpool/support/AbortPolicyWithReport.java +++ b/dubbo-common/src/main/java/org/apache/dubbo/common/threadpool/support/AbortPolicyWithReport.java @@ -156,13 +156,13 @@ private void dumpJStack() { if (!guard.tryAcquire()) { return; } - // To avoid multiple dump, check again - if (System.currentTimeMillis() - lastPrintTime < TEN_MINUTES_MILLS) { - return; - } - - ExecutorService pool = Executors.newSingleThreadExecutor(); + ExecutorService pool = null; try { + // To avoid multiple dump, check again + if (System.currentTimeMillis() - lastPrintTime < TEN_MINUTES_MILLS) { + return; + } + pool = Executors.newSingleThreadExecutor(); pool.execute(() -> { String dumpPath = getDumpPath(); @@ -186,12 +186,14 @@ private void dumpJStack() { logger.error(COMMON_UNEXPECTED_CREATE_DUMP, "", "", "dump jStack error", t); } finally { lastPrintTime = System.currentTimeMillis(); - guard.release(); } }); } finally { + guard.release(); // must shutdown thread pool ,if not will lead to OOM - pool.shutdown(); + if (pool != null) { + pool.shutdown(); + } } } From 20e0b57a8187928f277f4c0f7b1b1c5cef198308 Mon Sep 17 00:00:00 2001 From: wxbty Date: Tue, 9 Jan 2024 20:51:55 +0800 Subject: [PATCH 13/40] fix --- .github/workflows/build-and-bh-pr.yml | 432 ++++++++++++++++++++++++++ 1 file changed, 432 insertions(+) create mode 100644 .github/workflows/build-and-bh-pr.yml diff --git a/.github/workflows/build-and-bh-pr.yml b/.github/workflows/build-and-bh-pr.yml new file mode 100644 index 00000000000..2faa642416f --- /dev/null +++ b/.github/workflows/build-and-bh-pr.yml @@ -0,0 +1,432 @@ +name: Build and Test For PR + +on: [push, pull_request, workflow_dispatch] + +permissions: + contents: read + +env: + FORK_COUNT: 2 + FAIL_FAST: 0 + SHOW_ERROR_DETAIL: 1 + #multi-version size limit + VERSIONS_LIMIT: 4 + JACOCO_ENABLE: true + CANDIDATE_VERSIONS: ' + spring.version:5.3.24; + spring-boot.version:2.7.6; + ' + +jobs: + license: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v3 + - name: Check License + uses: apache/skywalking-eyes@e1a02359b239bd28de3f6d35fdc870250fa513d5 + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + - name: "Set up JDK 21" + uses: actions/setup-java@v3 + with: + distribution: 'zulu' + java-version: 21 + - name: "Compile Dubbo (Linux)" + run: | + ./mvnw --batch-mode --no-snapshot-updates -e --no-transfer-progress --fail-fast -T 2C clean install -DskipTests=true -DskipIntegrationTests=true -Dcheckstyle.skip=true -Dcheckstyle_unix.skip=true -Drat.skip=true -Dmaven.javadoc.skip=true + - name: Check Dependencies' License + uses: apache/skywalking-eyes/dependency@e1a02359b239bd28de3f6d35fdc870250fa513d5 + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + with: + config: .licenserc.yaml + mode: check + + build-source: + runs-on: ubuntu-latest + outputs: + version: ${{ steps.dubbo-version.outputs.version }} + steps: + - uses: actions/checkout@v3 + with: + path: dubbo + - uses: actions/setup-java@v3 + with: + distribution: 'zulu' + java-version: 17 + - uses: actions/cache@v3 + name: "Cache local Maven repository" + with: + path: ~/.m2/repository + key: ${{ runner.os }}-maven-${{ hashFiles('**/pom.xml') }}-${{ github.run_id }} + restore-keys: | + ${{ runner.os }}-maven-${{ hashFiles('**/pom.xml') }} + ${{ runner.os }}-maven- + - name: "Dubbo cache" + uses: actions/cache@v3 + with: + path: ~/.m2/repository/org/apache/dubbo + key: ${{ runner.os }}-dubbo-snapshot-${{ github.sha }}-${{ github.run_id }} + - name: "Build Dubbo with Maven" + run: | + cd ./dubbo + ./mvnw --batch-mode --no-snapshot-updates -e --no-transfer-progress --fail-fast clean source:jar install -Pjacoco,checkstyle -Dmaven.wagon.httpconnectionManager.ttlSeconds=120 -Dmaven.wagon.http.retryHandler.count=5 -Dmaven.test.skip=true -Dmaven.test.skip.exec=true -DembeddedZookeeperPath=${{ github.workspace }}/.tmp/zookeeper + - name: "Pack class result" + run: | + shopt -s globstar + zip ${{ github.workspace }}/class.zip **/target/classes/* -r + - name: "Upload class result" + uses: actions/upload-artifact@v3 + with: + name: "class-file" + path: ${{ github.workspace }}/class.zip + - name: "Pack checkstyle file if failure" + if: failure() + run: zip ${{ github.workspace }}/checkstyle.zip *checkstyle* -r + - name: "Upload checkstyle file if failure" + if: failure() + uses: actions/upload-artifact@v3 + with: + name: "checkstyle-file" + path: ${{ github.workspace }}/checkstyle.zip + - name: "Calculate Dubbo Version" + id: dubbo-version + run: | + REVISION=`awk '/[^<]+<\/revision>/{gsub(/|<\/revision>/,"",$1);print $1;exit;}' ./dubbo/pom.xml` + echo "version=$REVISION" >> $GITHUB_OUTPUT + echo "dubbo version: $REVISION" + + + unit-test: + needs: [build-source, unit-test-prepare] + name: "Unit Test On ubuntu-latest" + runs-on: ubuntu-latest + strategy: + fail-fast: false + env: + DISABLE_FILE_SYSTEM_TEST: true + CURRENT_ROLE: ${{ matrix.case-role }} + DUBBO_DEFAULT_SERIALIZATION: fastjson2 + steps: + - uses: actions/checkout@v3 + with: + fetch-depth: 0 + - name: "Set up JDK ${{ matrix.jdk }}" + uses: actions/setup-java@v3 + with: + distribution: 'zulu' + java-version: 21 + - uses: actions/cache@v3 + name: "Cache local Maven repository" + with: + path: ~/.m2/repository + key: ${{ runner.os }}-maven-${{ hashFiles('**/pom.xml') }}-${{ github.run_id }} + restore-keys: | + ${{ runner.os }}-maven-${{ hashFiles('**/pom.xml') }} + ${{ runner.os }}-maven- + - uses: actions/cache@v3 + name: "Cache zookeeper binary archive" + id: "cache-zookeeper" + with: + path: ${{ github.workspace }}/.tmp/zookeeper + key: zookeeper-${{ runner.os }}-${{ env.ZOOKEEPER_VERSION }} + restore-keys: | + zookeeper-${{ runner.os }}- + - uses: actions/cache@v3 + name: "Cache secret key" + id: "cache-secret-cert" + with: + path: ${{ github.workspace }}/.tmp/rsa + key: secret-rsa-${{ runner.os }}-${{ github.run_id }} + - name: "Get sonarcloud token" + if: ${{ github.repository == 'apache/dubbo' }} + run: | + curl "http://dubbo-vm.apache.org:8000/token?workflow_id=${{ github.run_id }}" -o ${{ github.workspace }}/.tmp/encrypted-sonarcloud-token + openssl rsautl -decrypt -in ${{ github.workspace }}/.tmp/encrypted-sonarcloud-token -out ${{ github.workspace }}/.tmp/decrypted-sonarcloud-token -inkey ${{ github.workspace }}/.tmp/rsa/rsa_private.pem + - name: "Test with Maven with SonarCloud Scan" + if: ${{ github.repository == 'apache/dubbo' }} + timeout-minutes: 90 + env: + # Needed to get some information about the pull request, if any + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + run: | + source ${{ github.workspace }}/.tmp/decrypted-sonarcloud-token + ./mvnw --batch-mode --no-snapshot-updates -e --no-transfer-progress --fail-fast clean test verify org.sonarsource.scanner.maven:sonar-maven-plugin:sonar -Pjacoco,jdk15ge-simple,'!jdk15ge',jacoco089 -Dsonar.host.url=https://sonarcloud.io -Dsonar.organization=apache -Dsonar.projectKey=apache_dubbo -DtrimStackTrace=false -Dmaven.wagon.httpconnectionManager.ttlSeconds=120 -Dmaven.wagon.http.retryHandler.count=5 -DskipTests=false -DskipIntegrationTests=false -Dcheckstyle.skip=false -Dcheckstyle_unix.skip=false -Drat.skip=false -Dmaven.javadoc.skip=true -DembeddedZookeeperPath=${{ github.workspace }}/.tmp/zookeeper -Dsonar.coverage.jacoco.xmlReportPaths=dubbo-test/dubbo-dependencies-all/target/site/jacoco-aggregate/jacoco.xml -Dsonar.login=${SONAR_TOKEN} + - name: "Test with Maven without SonarCloud Scan" + if: ${{ github.repository != 'apache/dubbo' }} + timeout-minutes: 90 + run: | + ./mvnw --batch-mode --no-snapshot-updates -e --no-transfer-progress --fail-fast clean test verify -Dmaven.wagon.httpconnectionManager.ttlSeconds=120 -Pjacoco,jdk15ge-simple,'!jdk15ge',jacoco089 -DtrimStackTrace=false -Dmaven.wagon.http.retryHandler.count=5 -DskipTests=false -DskipIntegrationTests=false -Dcheckstyle.skip=false -Dcheckstyle_unix.skip=false -Drat.skip=false -Dmaven.javadoc.skip=true -DembeddedZookeeperPath=${{ github.workspace }}/.tmp/zookeeper + - name: "Upload coverage result" + uses: actions/upload-artifact@v3 + with: + name: coverage-result + path: "**/target/site/**/jacoco.xml" + + integration-test-prepare: + runs-on: ubuntu-latest + env: + JOB_COUNT: 3 + steps: + - uses: actions/checkout@v3 + with: + repository: 'apache/dubbo-samples' + ref: master + - name: "Prepare test list" + run: | + bash ./test/scripts/prepare-test.sh + - name: "Upload test list" + uses: actions/upload-artifact@v3 + with: + name: test-list + path: test/jobs + + integration-test-job: + needs: [build-source, integration-test-prepare] + name: "Integration Test on ubuntu-latest (JobId: ${{matrix.job_id}})" + runs-on: ubuntu-latest + timeout-minutes: 90 + env: + JAVA_VER: 8 + TEST_CASE_FILE: jobs/testjob_${{matrix.job_id}}.txt + strategy: + fail-fast: false + matrix: + job_id: [1, 2, 3] + steps: + - uses: actions/checkout@v3 + with: + repository: 'apache/dubbo-samples' + ref: master + - name: "Cache local Maven repository" + uses: actions/cache@v3 + with: + path: ~/.m2/repository + key: ${{ runner.os }}-maven-${{ hashFiles('**/pom.xml') }}-${{ github.run_id }} + restore-keys: | + ${{ runner.os }}-maven-${{ hashFiles('**/pom.xml') }} + ${{ runner.os }}-maven- + - name: "Restore Dubbo cache" + uses: actions/cache@v3 + with: + path: ~/.m2/repository/org/apache/dubbo + key: ${{ runner.os }}-dubbo-snapshot-${{ github.sha }}-${{ github.run_id }} + restore-keys: | + ${{ runner.os }}-dubbo-snapshot-${{ github.sha }} + ${{ runner.os }}-dubbo-snapshot- + - name: "Download test list" + uses: actions/download-artifact@v3 + with: + name: test-list + path: test/jobs/ + - name: "Set up JDK 8" + uses: actions/setup-java@v3 + with: + distribution: 'zulu' + java-version: 8 + - name: "Init Candidate Versions" + run: | + DUBBO_VERSION="${{needs.build-source.outputs.version}}" + CANDIDATE_VERSIONS="dubbo.version:$DUBBO_VERSION;compiler.version:$DUBBO_VERSION;$CANDIDATE_VERSIONS;dubbo.compiler.version:$DUBBO_VERSION" + echo "CANDIDATE_VERSIONS=$CANDIDATE_VERSIONS" >> $GITHUB_ENV + - name: "Build test image" + run: | + cd test && bash ./build-test-image.sh + - name: "Run tests" + run: cd test && bash ./run-tests.sh + - name: "merge jacoco resule" + run: | + cd test/dubbo-test-jacoco-merger && mvn clean compile exec:java -Dexec.mainClass="org.apache.dubbo.test.JacocoMerge" -Dexec.args="${{github.workspace}}" + - name: "Upload jacoco" + uses: actions/upload-artifact@v3 + with: + name: jacoco-result + path: target/jacoco*.exec + - name: "Upload test result" + if: always() + uses: actions/upload-artifact@v3 + with: + name: test-result + path: test/jobs/*-result* + + integration-test-result: + needs: [integration-test-job] + if: always() + runs-on: ubuntu-latest + env: + JAVA_VER: 8 + steps: + - uses: actions/checkout@v3 + with: + repository: 'apache/dubbo-samples' + ref: master + - name: "Download test result" + uses: actions/download-artifact@v3 + with: + name: test-result + path: test/jobs/ + - name: "Merge test result" + run: ./test/scripts/merge-test-results.sh + + jacoco-result-merge: + runs-on: ubuntu-latest + needs: [integration-test-result, unit-test] + steps: + - uses: actions/checkout@v3 + with: + path: "./dubbo" + - uses: actions/checkout@v3 + with: + repository: 'apache/dubbo-samples' + path: "./dubbo-samples" + - name: "Set up JDK 21" + uses: actions/setup-java@v3 + with: + distribution: 'zulu' + java-version: 21 + - name: "Restore class result" + uses: actions/download-artifact@v3 + with: + name: "class-file" + path: ${{ github.workspace }} + - name: "Unpack class result" + run: | + cd ${{ github.workspace }}/dubbo + unzip -o ${{ github.workspace }}/class.zip + - name: "Restore jacoco exec" + uses: actions/download-artifact@v3 + with: + name: jacoco-result + path: dubbo-samples/target/ + - name: "Merge jacoco result" + run: | + cd ${{ github.workspace }}/dubbo-samples/test/dubbo-test-jacoco-merger + mvn clean compile exec:java -Dexec.mainClass="org.apache.dubbo.test.JacocoReport" -Dexec.args="${{github.workspace}}/dubbo-samples ${{github.workspace}}/dubbo" + - name: "Restore coverage result" + uses: actions/download-artifact@v3 + with: + name: coverage-result + path: dubbo/ + - name: "Upload coverage to Codecov" + uses: codecov/codecov-action@v3 + with: + verbose: true + + error-code-inspecting: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v3 + with: + path: "./dubbo" + + - uses: actions/checkout@v3 + with: + repository: 'apache/dubbo-test-tools' + ref: main + path: "./dubbo-test-tools" + + - name: "Set up JDK 21" + uses: actions/setup-java@v3 + with: + distribution: 'zulu' + java-version: 21 + + - name: "Compile Dubbo (Linux)" + run: | + cd ${{ github.workspace }}/dubbo + ./mvnw --batch-mode --no-snapshot-updates -e --no-transfer-progress --fail-fast -T 2C clean install -DskipTests=true -DskipIntegrationTests=true -Dcheckstyle.skip=true -Dcheckstyle_unix.skip=true -Drat.skip=true -Dmaven.javadoc.skip=true + - name: "Run Error Code Inspecting" + env: + DUBBO_ECI_REPORT_AS_ERROR: true + run: | + cd ${{ github.workspace }}/dubbo-test-tools/dubbo-error-code-inspector + ../mvnw --batch-mode --no-snapshot-updates -e --no-transfer-progress --fail-fast -T 2C package exec:java -Ddubbo.eci.report-as-error=${DUBBO_ECI_REPORT_AS_ERROR} -Dmaven.test.skip=true -Dmaven.test.skip.exec=true -Ddubbo.eci.path=${{ github.workspace }}/dubbo + + - name: "Upload error code inspection result" + # always() should not be used here, since we don't need to handle the 'canceled' situation. + if: ${{ success() || failure() }} + uses: actions/upload-artifact@v3 + with: + name: "error-inspection-result" + path: ${{ github.workspace }}/dubbo-test-tools/dubbo-error-code-inspector/error-inspection-result.txt + + native-image-inspecting: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v3 + with: + path: "./dubbo" + + - name: "Setup GraalVM environment" + uses: graalvm/setup-graalvm@v1 + with: + version: '22.3.0' + java-version: '17' + components: 'native-image' + github-token: ${{ secrets.GITHUB_TOKEN }} + native-image-job-reports: 'true' + + - name: "Setup Zookeeper environment" + run: | + wget https://dlcdn.apache.org/zookeeper/zookeeper-3.8.3/apache-zookeeper-3.8.3-bin.tar.gz + tar -zxvf apache-zookeeper-3.8.3-bin.tar.gz + mv apache-zookeeper-3.8.3-bin/conf/zoo_sample.cfg apache-zookeeper-3.8.3-bin/conf/zoo.cfg + apache-zookeeper-3.8.3-bin/bin/zkServer.sh start + + - name: "Check environment" + run: | + java --version + native-image --version + + - name: "Compile Dubbo (Linux)" + run: | + cd ${{ github.workspace }}/dubbo + ./mvnw --batch-mode --no-snapshot-updates -e --no-transfer-progress --fail-fast -T 2C clean install -DskipTests=true -DskipIntegrationTests=true -Dcheckstyle.skip=true -Dcheckstyle_unix.skip=true -Drat.skip=true -Dmaven.javadoc.skip=true + + - name: "Compile and run Dubbo demo for native (Linux)" + run: | + cd ${{ github.workspace }}/dubbo/dubbo-demo/dubbo-demo-native/dubbo-demo-native-provider + ${{ github.workspace }}/dubbo/mvnw --batch-mode --no-snapshot-updates -e --no-transfer-progress --fail-fast -T 2C clean package -P native -Dmaven.test.skip=true native:compile + nohup ./target/dubbo-demo-native-provider & + cd ${{ github.workspace }}/dubbo/dubbo-demo/dubbo-demo-native/dubbo-demo-native-consumer + ${{ github.workspace }}/dubbo/mvnw --batch-mode --no-snapshot-updates -e --no-transfer-progress --fail-fast -T 2C clean package -P native -Dmaven.test.skip=true native:compile + ./target/dubbo-demo-native-consumer + + integration-benchmark-prepare: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v3 + with: + repository: 'wxbty/dubbo-benchmark' + ref: continuous + + integration-benchmark-job: + needs: [build-source, integration-benchmark-prepare] + name: "Integration Benchmark on ubuntu-latest (JobId: ${{matrix.job_id}})" + runs-on: ubuntu-latest + timeout-minutes: 90 + env: + JAVA_VER: 8 + TEST_CASE_FILE: jobs/bh_job_${{matrix.job_id}}.txt + strategy: + fail-fast: false + steps: + - uses: actions/checkout@v3 + with: + repository: 'wxbty/dubbo-benchmark' + ref: continuous + - name: "Set up JDK 8" + uses: actions/setup-java@v3 + with: + distribution: 'zulu' + java-version: 8 + - name: "Init Candidate Versions" + run: | + DUBBO_VERSION="${{needs.build-source.outputs.version}}" + CANDIDATE_VERSIONS="dubbo.version:$DUBBO_VERSION;compiler.version:$DUBBO_VERSION;$CANDIDATE_VERSIONS;dubbo.compiler.version:$DUBBO_VERSION" + echo "CANDIDATE_VERSIONS=$CANDIDATE_VERSIONS" >> $GITHUB_ENV + - name: "Run bh server" + run: | + ./benchmark.sh dubbo-metrics-server/ + - name: "Run bh client" + run: cd test && bash ./run-dubbo-benchmark.sh From 4c528230eb4b4751b176e5dc94a20eddf6df20ae Mon Sep 17 00:00:00 2001 From: wxbty Date: Tue, 9 Jan 2024 20:56:08 +0800 Subject: [PATCH 14/40] add test ci --- .../metrics/registry/collector/RegistryMetricsCollector.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/dubbo-metrics/dubbo-metrics-registry/src/main/java/org/apache/dubbo/metrics/registry/collector/RegistryMetricsCollector.java b/dubbo-metrics/dubbo-metrics-registry/src/main/java/org/apache/dubbo/metrics/registry/collector/RegistryMetricsCollector.java index c10bca41ddd..906ca0b4b41 100644 --- a/dubbo-metrics/dubbo-metrics-registry/src/main/java/org/apache/dubbo/metrics/registry/collector/RegistryMetricsCollector.java +++ b/dubbo-metrics/dubbo-metrics-registry/src/main/java/org/apache/dubbo/metrics/registry/collector/RegistryMetricsCollector.java @@ -54,7 +54,7 @@ @Activate public class RegistryMetricsCollector extends CombMetricsCollector { - private Boolean collectEnabled = null; + private Boolean collectEnabled = false; private final ApplicationModel applicationModel; private final RegistryStatComposite internalStat; From 50612ad3a73d313d11a045a829d6129290ccc9cd Mon Sep 17 00:00:00 2001 From: wxbty <38374721+wxbty@users.noreply.github.com> Date: Tue, 9 Jan 2024 21:34:27 +0800 Subject: [PATCH 15/40] Revert 13609 due to misoperation (#13634) * Revert "add test ci" This reverts commit 4c528230eb4b4751b176e5dc94a20eddf6df20ae. * Revert "fix" This reverts commit 20e0b57a8187928f277f4c0f7b1b1c5cef198308. --- .github/workflows/build-and-bh-pr.yml | 432 ------------------ .../collector/RegistryMetricsCollector.java | 2 +- 2 files changed, 1 insertion(+), 433 deletions(-) delete mode 100644 .github/workflows/build-and-bh-pr.yml diff --git a/.github/workflows/build-and-bh-pr.yml b/.github/workflows/build-and-bh-pr.yml deleted file mode 100644 index 2faa642416f..00000000000 --- a/.github/workflows/build-and-bh-pr.yml +++ /dev/null @@ -1,432 +0,0 @@ -name: Build and Test For PR - -on: [push, pull_request, workflow_dispatch] - -permissions: - contents: read - -env: - FORK_COUNT: 2 - FAIL_FAST: 0 - SHOW_ERROR_DETAIL: 1 - #multi-version size limit - VERSIONS_LIMIT: 4 - JACOCO_ENABLE: true - CANDIDATE_VERSIONS: ' - spring.version:5.3.24; - spring-boot.version:2.7.6; - ' - -jobs: - license: - runs-on: ubuntu-latest - steps: - - uses: actions/checkout@v3 - - name: Check License - uses: apache/skywalking-eyes@e1a02359b239bd28de3f6d35fdc870250fa513d5 - env: - GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} - - name: "Set up JDK 21" - uses: actions/setup-java@v3 - with: - distribution: 'zulu' - java-version: 21 - - name: "Compile Dubbo (Linux)" - run: | - ./mvnw --batch-mode --no-snapshot-updates -e --no-transfer-progress --fail-fast -T 2C clean install -DskipTests=true -DskipIntegrationTests=true -Dcheckstyle.skip=true -Dcheckstyle_unix.skip=true -Drat.skip=true -Dmaven.javadoc.skip=true - - name: Check Dependencies' License - uses: apache/skywalking-eyes/dependency@e1a02359b239bd28de3f6d35fdc870250fa513d5 - env: - GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} - with: - config: .licenserc.yaml - mode: check - - build-source: - runs-on: ubuntu-latest - outputs: - version: ${{ steps.dubbo-version.outputs.version }} - steps: - - uses: actions/checkout@v3 - with: - path: dubbo - - uses: actions/setup-java@v3 - with: - distribution: 'zulu' - java-version: 17 - - uses: actions/cache@v3 - name: "Cache local Maven repository" - with: - path: ~/.m2/repository - key: ${{ runner.os }}-maven-${{ hashFiles('**/pom.xml') }}-${{ github.run_id }} - restore-keys: | - ${{ runner.os }}-maven-${{ hashFiles('**/pom.xml') }} - ${{ runner.os }}-maven- - - name: "Dubbo cache" - uses: actions/cache@v3 - with: - path: ~/.m2/repository/org/apache/dubbo - key: ${{ runner.os }}-dubbo-snapshot-${{ github.sha }}-${{ github.run_id }} - - name: "Build Dubbo with Maven" - run: | - cd ./dubbo - ./mvnw --batch-mode --no-snapshot-updates -e --no-transfer-progress --fail-fast clean source:jar install -Pjacoco,checkstyle -Dmaven.wagon.httpconnectionManager.ttlSeconds=120 -Dmaven.wagon.http.retryHandler.count=5 -Dmaven.test.skip=true -Dmaven.test.skip.exec=true -DembeddedZookeeperPath=${{ github.workspace }}/.tmp/zookeeper - - name: "Pack class result" - run: | - shopt -s globstar - zip ${{ github.workspace }}/class.zip **/target/classes/* -r - - name: "Upload class result" - uses: actions/upload-artifact@v3 - with: - name: "class-file" - path: ${{ github.workspace }}/class.zip - - name: "Pack checkstyle file if failure" - if: failure() - run: zip ${{ github.workspace }}/checkstyle.zip *checkstyle* -r - - name: "Upload checkstyle file if failure" - if: failure() - uses: actions/upload-artifact@v3 - with: - name: "checkstyle-file" - path: ${{ github.workspace }}/checkstyle.zip - - name: "Calculate Dubbo Version" - id: dubbo-version - run: | - REVISION=`awk '/[^<]+<\/revision>/{gsub(/|<\/revision>/,"",$1);print $1;exit;}' ./dubbo/pom.xml` - echo "version=$REVISION" >> $GITHUB_OUTPUT - echo "dubbo version: $REVISION" - - - unit-test: - needs: [build-source, unit-test-prepare] - name: "Unit Test On ubuntu-latest" - runs-on: ubuntu-latest - strategy: - fail-fast: false - env: - DISABLE_FILE_SYSTEM_TEST: true - CURRENT_ROLE: ${{ matrix.case-role }} - DUBBO_DEFAULT_SERIALIZATION: fastjson2 - steps: - - uses: actions/checkout@v3 - with: - fetch-depth: 0 - - name: "Set up JDK ${{ matrix.jdk }}" - uses: actions/setup-java@v3 - with: - distribution: 'zulu' - java-version: 21 - - uses: actions/cache@v3 - name: "Cache local Maven repository" - with: - path: ~/.m2/repository - key: ${{ runner.os }}-maven-${{ hashFiles('**/pom.xml') }}-${{ github.run_id }} - restore-keys: | - ${{ runner.os }}-maven-${{ hashFiles('**/pom.xml') }} - ${{ runner.os }}-maven- - - uses: actions/cache@v3 - name: "Cache zookeeper binary archive" - id: "cache-zookeeper" - with: - path: ${{ github.workspace }}/.tmp/zookeeper - key: zookeeper-${{ runner.os }}-${{ env.ZOOKEEPER_VERSION }} - restore-keys: | - zookeeper-${{ runner.os }}- - - uses: actions/cache@v3 - name: "Cache secret key" - id: "cache-secret-cert" - with: - path: ${{ github.workspace }}/.tmp/rsa - key: secret-rsa-${{ runner.os }}-${{ github.run_id }} - - name: "Get sonarcloud token" - if: ${{ github.repository == 'apache/dubbo' }} - run: | - curl "http://dubbo-vm.apache.org:8000/token?workflow_id=${{ github.run_id }}" -o ${{ github.workspace }}/.tmp/encrypted-sonarcloud-token - openssl rsautl -decrypt -in ${{ github.workspace }}/.tmp/encrypted-sonarcloud-token -out ${{ github.workspace }}/.tmp/decrypted-sonarcloud-token -inkey ${{ github.workspace }}/.tmp/rsa/rsa_private.pem - - name: "Test with Maven with SonarCloud Scan" - if: ${{ github.repository == 'apache/dubbo' }} - timeout-minutes: 90 - env: - # Needed to get some information about the pull request, if any - GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} - run: | - source ${{ github.workspace }}/.tmp/decrypted-sonarcloud-token - ./mvnw --batch-mode --no-snapshot-updates -e --no-transfer-progress --fail-fast clean test verify org.sonarsource.scanner.maven:sonar-maven-plugin:sonar -Pjacoco,jdk15ge-simple,'!jdk15ge',jacoco089 -Dsonar.host.url=https://sonarcloud.io -Dsonar.organization=apache -Dsonar.projectKey=apache_dubbo -DtrimStackTrace=false -Dmaven.wagon.httpconnectionManager.ttlSeconds=120 -Dmaven.wagon.http.retryHandler.count=5 -DskipTests=false -DskipIntegrationTests=false -Dcheckstyle.skip=false -Dcheckstyle_unix.skip=false -Drat.skip=false -Dmaven.javadoc.skip=true -DembeddedZookeeperPath=${{ github.workspace }}/.tmp/zookeeper -Dsonar.coverage.jacoco.xmlReportPaths=dubbo-test/dubbo-dependencies-all/target/site/jacoco-aggregate/jacoco.xml -Dsonar.login=${SONAR_TOKEN} - - name: "Test with Maven without SonarCloud Scan" - if: ${{ github.repository != 'apache/dubbo' }} - timeout-minutes: 90 - run: | - ./mvnw --batch-mode --no-snapshot-updates -e --no-transfer-progress --fail-fast clean test verify -Dmaven.wagon.httpconnectionManager.ttlSeconds=120 -Pjacoco,jdk15ge-simple,'!jdk15ge',jacoco089 -DtrimStackTrace=false -Dmaven.wagon.http.retryHandler.count=5 -DskipTests=false -DskipIntegrationTests=false -Dcheckstyle.skip=false -Dcheckstyle_unix.skip=false -Drat.skip=false -Dmaven.javadoc.skip=true -DembeddedZookeeperPath=${{ github.workspace }}/.tmp/zookeeper - - name: "Upload coverage result" - uses: actions/upload-artifact@v3 - with: - name: coverage-result - path: "**/target/site/**/jacoco.xml" - - integration-test-prepare: - runs-on: ubuntu-latest - env: - JOB_COUNT: 3 - steps: - - uses: actions/checkout@v3 - with: - repository: 'apache/dubbo-samples' - ref: master - - name: "Prepare test list" - run: | - bash ./test/scripts/prepare-test.sh - - name: "Upload test list" - uses: actions/upload-artifact@v3 - with: - name: test-list - path: test/jobs - - integration-test-job: - needs: [build-source, integration-test-prepare] - name: "Integration Test on ubuntu-latest (JobId: ${{matrix.job_id}})" - runs-on: ubuntu-latest - timeout-minutes: 90 - env: - JAVA_VER: 8 - TEST_CASE_FILE: jobs/testjob_${{matrix.job_id}}.txt - strategy: - fail-fast: false - matrix: - job_id: [1, 2, 3] - steps: - - uses: actions/checkout@v3 - with: - repository: 'apache/dubbo-samples' - ref: master - - name: "Cache local Maven repository" - uses: actions/cache@v3 - with: - path: ~/.m2/repository - key: ${{ runner.os }}-maven-${{ hashFiles('**/pom.xml') }}-${{ github.run_id }} - restore-keys: | - ${{ runner.os }}-maven-${{ hashFiles('**/pom.xml') }} - ${{ runner.os }}-maven- - - name: "Restore Dubbo cache" - uses: actions/cache@v3 - with: - path: ~/.m2/repository/org/apache/dubbo - key: ${{ runner.os }}-dubbo-snapshot-${{ github.sha }}-${{ github.run_id }} - restore-keys: | - ${{ runner.os }}-dubbo-snapshot-${{ github.sha }} - ${{ runner.os }}-dubbo-snapshot- - - name: "Download test list" - uses: actions/download-artifact@v3 - with: - name: test-list - path: test/jobs/ - - name: "Set up JDK 8" - uses: actions/setup-java@v3 - with: - distribution: 'zulu' - java-version: 8 - - name: "Init Candidate Versions" - run: | - DUBBO_VERSION="${{needs.build-source.outputs.version}}" - CANDIDATE_VERSIONS="dubbo.version:$DUBBO_VERSION;compiler.version:$DUBBO_VERSION;$CANDIDATE_VERSIONS;dubbo.compiler.version:$DUBBO_VERSION" - echo "CANDIDATE_VERSIONS=$CANDIDATE_VERSIONS" >> $GITHUB_ENV - - name: "Build test image" - run: | - cd test && bash ./build-test-image.sh - - name: "Run tests" - run: cd test && bash ./run-tests.sh - - name: "merge jacoco resule" - run: | - cd test/dubbo-test-jacoco-merger && mvn clean compile exec:java -Dexec.mainClass="org.apache.dubbo.test.JacocoMerge" -Dexec.args="${{github.workspace}}" - - name: "Upload jacoco" - uses: actions/upload-artifact@v3 - with: - name: jacoco-result - path: target/jacoco*.exec - - name: "Upload test result" - if: always() - uses: actions/upload-artifact@v3 - with: - name: test-result - path: test/jobs/*-result* - - integration-test-result: - needs: [integration-test-job] - if: always() - runs-on: ubuntu-latest - env: - JAVA_VER: 8 - steps: - - uses: actions/checkout@v3 - with: - repository: 'apache/dubbo-samples' - ref: master - - name: "Download test result" - uses: actions/download-artifact@v3 - with: - name: test-result - path: test/jobs/ - - name: "Merge test result" - run: ./test/scripts/merge-test-results.sh - - jacoco-result-merge: - runs-on: ubuntu-latest - needs: [integration-test-result, unit-test] - steps: - - uses: actions/checkout@v3 - with: - path: "./dubbo" - - uses: actions/checkout@v3 - with: - repository: 'apache/dubbo-samples' - path: "./dubbo-samples" - - name: "Set up JDK 21" - uses: actions/setup-java@v3 - with: - distribution: 'zulu' - java-version: 21 - - name: "Restore class result" - uses: actions/download-artifact@v3 - with: - name: "class-file" - path: ${{ github.workspace }} - - name: "Unpack class result" - run: | - cd ${{ github.workspace }}/dubbo - unzip -o ${{ github.workspace }}/class.zip - - name: "Restore jacoco exec" - uses: actions/download-artifact@v3 - with: - name: jacoco-result - path: dubbo-samples/target/ - - name: "Merge jacoco result" - run: | - cd ${{ github.workspace }}/dubbo-samples/test/dubbo-test-jacoco-merger - mvn clean compile exec:java -Dexec.mainClass="org.apache.dubbo.test.JacocoReport" -Dexec.args="${{github.workspace}}/dubbo-samples ${{github.workspace}}/dubbo" - - name: "Restore coverage result" - uses: actions/download-artifact@v3 - with: - name: coverage-result - path: dubbo/ - - name: "Upload coverage to Codecov" - uses: codecov/codecov-action@v3 - with: - verbose: true - - error-code-inspecting: - runs-on: ubuntu-latest - steps: - - uses: actions/checkout@v3 - with: - path: "./dubbo" - - - uses: actions/checkout@v3 - with: - repository: 'apache/dubbo-test-tools' - ref: main - path: "./dubbo-test-tools" - - - name: "Set up JDK 21" - uses: actions/setup-java@v3 - with: - distribution: 'zulu' - java-version: 21 - - - name: "Compile Dubbo (Linux)" - run: | - cd ${{ github.workspace }}/dubbo - ./mvnw --batch-mode --no-snapshot-updates -e --no-transfer-progress --fail-fast -T 2C clean install -DskipTests=true -DskipIntegrationTests=true -Dcheckstyle.skip=true -Dcheckstyle_unix.skip=true -Drat.skip=true -Dmaven.javadoc.skip=true - - name: "Run Error Code Inspecting" - env: - DUBBO_ECI_REPORT_AS_ERROR: true - run: | - cd ${{ github.workspace }}/dubbo-test-tools/dubbo-error-code-inspector - ../mvnw --batch-mode --no-snapshot-updates -e --no-transfer-progress --fail-fast -T 2C package exec:java -Ddubbo.eci.report-as-error=${DUBBO_ECI_REPORT_AS_ERROR} -Dmaven.test.skip=true -Dmaven.test.skip.exec=true -Ddubbo.eci.path=${{ github.workspace }}/dubbo - - - name: "Upload error code inspection result" - # always() should not be used here, since we don't need to handle the 'canceled' situation. - if: ${{ success() || failure() }} - uses: actions/upload-artifact@v3 - with: - name: "error-inspection-result" - path: ${{ github.workspace }}/dubbo-test-tools/dubbo-error-code-inspector/error-inspection-result.txt - - native-image-inspecting: - runs-on: ubuntu-latest - steps: - - uses: actions/checkout@v3 - with: - path: "./dubbo" - - - name: "Setup GraalVM environment" - uses: graalvm/setup-graalvm@v1 - with: - version: '22.3.0' - java-version: '17' - components: 'native-image' - github-token: ${{ secrets.GITHUB_TOKEN }} - native-image-job-reports: 'true' - - - name: "Setup Zookeeper environment" - run: | - wget https://dlcdn.apache.org/zookeeper/zookeeper-3.8.3/apache-zookeeper-3.8.3-bin.tar.gz - tar -zxvf apache-zookeeper-3.8.3-bin.tar.gz - mv apache-zookeeper-3.8.3-bin/conf/zoo_sample.cfg apache-zookeeper-3.8.3-bin/conf/zoo.cfg - apache-zookeeper-3.8.3-bin/bin/zkServer.sh start - - - name: "Check environment" - run: | - java --version - native-image --version - - - name: "Compile Dubbo (Linux)" - run: | - cd ${{ github.workspace }}/dubbo - ./mvnw --batch-mode --no-snapshot-updates -e --no-transfer-progress --fail-fast -T 2C clean install -DskipTests=true -DskipIntegrationTests=true -Dcheckstyle.skip=true -Dcheckstyle_unix.skip=true -Drat.skip=true -Dmaven.javadoc.skip=true - - - name: "Compile and run Dubbo demo for native (Linux)" - run: | - cd ${{ github.workspace }}/dubbo/dubbo-demo/dubbo-demo-native/dubbo-demo-native-provider - ${{ github.workspace }}/dubbo/mvnw --batch-mode --no-snapshot-updates -e --no-transfer-progress --fail-fast -T 2C clean package -P native -Dmaven.test.skip=true native:compile - nohup ./target/dubbo-demo-native-provider & - cd ${{ github.workspace }}/dubbo/dubbo-demo/dubbo-demo-native/dubbo-demo-native-consumer - ${{ github.workspace }}/dubbo/mvnw --batch-mode --no-snapshot-updates -e --no-transfer-progress --fail-fast -T 2C clean package -P native -Dmaven.test.skip=true native:compile - ./target/dubbo-demo-native-consumer - - integration-benchmark-prepare: - runs-on: ubuntu-latest - steps: - - uses: actions/checkout@v3 - with: - repository: 'wxbty/dubbo-benchmark' - ref: continuous - - integration-benchmark-job: - needs: [build-source, integration-benchmark-prepare] - name: "Integration Benchmark on ubuntu-latest (JobId: ${{matrix.job_id}})" - runs-on: ubuntu-latest - timeout-minutes: 90 - env: - JAVA_VER: 8 - TEST_CASE_FILE: jobs/bh_job_${{matrix.job_id}}.txt - strategy: - fail-fast: false - steps: - - uses: actions/checkout@v3 - with: - repository: 'wxbty/dubbo-benchmark' - ref: continuous - - name: "Set up JDK 8" - uses: actions/setup-java@v3 - with: - distribution: 'zulu' - java-version: 8 - - name: "Init Candidate Versions" - run: | - DUBBO_VERSION="${{needs.build-source.outputs.version}}" - CANDIDATE_VERSIONS="dubbo.version:$DUBBO_VERSION;compiler.version:$DUBBO_VERSION;$CANDIDATE_VERSIONS;dubbo.compiler.version:$DUBBO_VERSION" - echo "CANDIDATE_VERSIONS=$CANDIDATE_VERSIONS" >> $GITHUB_ENV - - name: "Run bh server" - run: | - ./benchmark.sh dubbo-metrics-server/ - - name: "Run bh client" - run: cd test && bash ./run-dubbo-benchmark.sh diff --git a/dubbo-metrics/dubbo-metrics-registry/src/main/java/org/apache/dubbo/metrics/registry/collector/RegistryMetricsCollector.java b/dubbo-metrics/dubbo-metrics-registry/src/main/java/org/apache/dubbo/metrics/registry/collector/RegistryMetricsCollector.java index 906ca0b4b41..c10bca41ddd 100644 --- a/dubbo-metrics/dubbo-metrics-registry/src/main/java/org/apache/dubbo/metrics/registry/collector/RegistryMetricsCollector.java +++ b/dubbo-metrics/dubbo-metrics-registry/src/main/java/org/apache/dubbo/metrics/registry/collector/RegistryMetricsCollector.java @@ -54,7 +54,7 @@ @Activate public class RegistryMetricsCollector extends CombMetricsCollector { - private Boolean collectEnabled = false; + private Boolean collectEnabled = null; private final ApplicationModel applicationModel; private final RegistryStatComposite internalStat; From 966efaab85a30d3d9339093381a7b069c2d71c64 Mon Sep 17 00:00:00 2001 From: MaruHibiki Date: Wed, 10 Jan 2024 11:27:48 +0800 Subject: [PATCH 16/40] do not invoke test method(#13589) (#13601) * do not invoke test method(#13589) * Fix style check --------- Co-authored-by: Albumen Kevin --- .../java/org/apache/dubbo/rpc/filter/ExceptionFilter.java | 4 +++- .../java/org/apache/dubbo/rpc/filter/ExceptionFilterTest.java | 2 +- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/dubbo-rpc/dubbo-rpc-api/src/main/java/org/apache/dubbo/rpc/filter/ExceptionFilter.java b/dubbo-rpc/dubbo-rpc-api/src/main/java/org/apache/dubbo/rpc/filter/ExceptionFilter.java index 0fc159967a8..e213cc9d2a4 100644 --- a/dubbo-rpc/dubbo-rpc-api/src/main/java/org/apache/dubbo/rpc/filter/ExceptionFilter.java +++ b/dubbo-rpc/dubbo-rpc-api/src/main/java/org/apache/dubbo/rpc/filter/ExceptionFilter.java @@ -18,6 +18,7 @@ import org.apache.dubbo.common.constants.CommonConstants; import org.apache.dubbo.common.extension.Activate; +import org.apache.dubbo.common.extension.DisableInject; import org.apache.dubbo.common.logger.ErrorTypeAwareLogger; import org.apache.dubbo.common.logger.LoggerFactory; import org.apache.dubbo.common.utils.ReflectUtils; @@ -140,7 +141,8 @@ public void onError(Throwable e, Invoker invoker, Invocation invocation) { } // For test purpose - public void setLogger(ErrorTypeAwareLogger logger) { + @DisableInject + public void mockLogger(ErrorTypeAwareLogger logger) { this.logger = logger; } } diff --git a/dubbo-rpc/dubbo-rpc-api/src/test/java/org/apache/dubbo/rpc/filter/ExceptionFilterTest.java b/dubbo-rpc/dubbo-rpc-api/src/test/java/org/apache/dubbo/rpc/filter/ExceptionFilterTest.java index 76c964d8cfb..6a5d6ad4174 100644 --- a/dubbo-rpc/dubbo-rpc-api/src/test/java/org/apache/dubbo/rpc/filter/ExceptionFilterTest.java +++ b/dubbo-rpc/dubbo-rpc-api/src/test/java/org/apache/dubbo/rpc/filter/ExceptionFilterTest.java @@ -63,7 +63,7 @@ void testRpcException() { exceptionFilter.invoke(invoker, invocation); } catch (RpcException e) { assertEquals("TestRpcException", e.getMessage()); - exceptionFilter.setLogger(failsafeLogger); + exceptionFilter.mockLogger(failsafeLogger); exceptionFilter.onError(e, invoker, invocation); } From b5a8c7df551789c3364f89d7947854e516a7e3e7 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Wed, 10 Jan 2024 16:37:48 +0800 Subject: [PATCH 17/40] Bump io.opentelemetry:opentelemetry-bom from 1.33.0 to 1.34.0 (#13628) Bumps [io.opentelemetry:opentelemetry-bom](https://github.com/open-telemetry/opentelemetry-java) from 1.33.0 to 1.34.0. - [Release notes](https://github.com/open-telemetry/opentelemetry-java/releases) - [Changelog](https://github.com/open-telemetry/opentelemetry-java/blob/main/CHANGELOG.md) - [Commits](https://github.com/open-telemetry/opentelemetry-java/compare/v1.33.0...v1.34.0) --- updated-dependencies: - dependency-name: io.opentelemetry:opentelemetry-bom dependency-type: direct:production update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- .../dubbo-spring-boot-starters/observability/pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/dubbo-spring-boot/dubbo-spring-boot-starters/observability/pom.xml b/dubbo-spring-boot/dubbo-spring-boot-starters/observability/pom.xml index 17e867dc4b5..a9b09df3e8a 100644 --- a/dubbo-spring-boot/dubbo-spring-boot-starters/observability/pom.xml +++ b/dubbo-spring-boot/dubbo-spring-boot-starters/observability/pom.xml @@ -38,7 +38,7 @@ 1.12.1 1.2.1 - 1.33.0 + 1.34.0 2.17.2 0.16.0 From 05d44abe933f03024f57efd8779d6595f38e7395 Mon Sep 17 00:00:00 2001 From: Y Date: Wed, 10 Jan 2024 19:23:24 +0800 Subject: [PATCH 18/40] add registryUrl parameters from multipleRegistryUrl #13603 (#13633) Co-authored-by: shaowei ye --- .../org/apache/dubbo/registry/multiple/MultipleRegistry.java | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/dubbo-registry/dubbo-registry-multiple/src/main/java/org/apache/dubbo/registry/multiple/MultipleRegistry.java b/dubbo-registry/dubbo-registry-multiple/src/main/java/org/apache/dubbo/registry/multiple/MultipleRegistry.java index 82f9bbef5f9..44a2e571261 100644 --- a/dubbo-registry/dubbo-registry-multiple/src/main/java/org/apache/dubbo/registry/multiple/MultipleRegistry.java +++ b/dubbo-registry/dubbo-registry-multiple/src/main/java/org/apache/dubbo/registry/multiple/MultipleRegistry.java @@ -124,8 +124,9 @@ protected void initReferenceRegistry(URL url, Map registryMap) referenceRegistries.put(tmpUrl, registryMap.get(tmpUrl)); continue; } - final URL registryUrl = - URL.valueOf(tmpUrl).addParameterIfAbsent(CHECK_KEY, url.getParameter(CHECK_KEY, "true")); + final URL registryUrl = URL.valueOf(tmpUrl) + .addParametersIfAbsent(url.getParameters()) + .addParameterIfAbsent(CHECK_KEY, url.getParameter(CHECK_KEY, "true")); Registry registry = registryFactory.getRegistry(registryUrl); registryMap.put(tmpUrl, registry); referenceRegistries.put(tmpUrl, registry); From 9d04bc5c250f9a86e7d3dfb2ac03629fc9194693 Mon Sep 17 00:00:00 2001 From: zrlw Date: Fri, 12 Jan 2024 22:55:18 +0800 Subject: [PATCH 19/40] stop startup if dubbo application name configuration is invalid (#13343) --- .../config/utils/ConfigValidationUtils.java | 18 +++++++++++++----- .../dubbo/config/ReferenceConfigTest.java | 2 +- .../utils/ConfigValidationUtilsTest.java | 3 +++ 3 files changed, 17 insertions(+), 6 deletions(-) diff --git a/dubbo-config/dubbo-config-api/src/main/java/org/apache/dubbo/config/utils/ConfigValidationUtils.java b/dubbo-config/dubbo-config-api/src/main/java/org/apache/dubbo/config/utils/ConfigValidationUtils.java index 728aa218450..afa057ae7f0 100644 --- a/dubbo-config/dubbo-config-api/src/main/java/org/apache/dubbo/config/utils/ConfigValidationUtils.java +++ b/dubbo-config/dubbo-config-api/src/main/java/org/apache/dubbo/config/utils/ConfigValidationUtils.java @@ -491,6 +491,12 @@ public static void validateApplicationConfig(ApplicationConfig config) { + "Please add to your spring config."); } + String name = config.getName(); + if (!checkName(NAME, name)) { + throw new IllegalStateException( + String.format("please correct dubbo application name: %s at your spring config.", name)); + } + // backward compatibility ScopeModel scopeModel = ScopeModelUtil.getOrDefaultApplicationModel(config.getScopeModel()); PropertiesConfiguration configuration = scopeModel.modelEnvironment().getPropertiesConfiguration(); @@ -504,7 +510,6 @@ public static void validateApplicationConfig(ApplicationConfig config) { } } - checkName(NAME, config.getName()); checkMultiName(OWNER, config.getOwner()); checkName(ORGANIZATION, config.getOrganization()); checkName(ARCHITECTURE, config.getArchitecture()); @@ -732,8 +737,8 @@ public static void checkPathLength(String property, String value) { checkProperty(property, value, MAX_PATH_LENGTH, null); } - public static void checkName(String property, String value) { - checkProperty(property, value, MAX_LENGTH, PATTERN_NAME); + public static boolean checkName(String property, String value) { + return checkProperty(property, value, MAX_LENGTH, PATTERN_NAME); } public static void checkHost(String property, String value) { @@ -789,9 +794,9 @@ public static void checkParameterName(Map parameters) { } } - public static void checkProperty(String property, String value, int maxlength, Pattern pattern) { + public static boolean checkProperty(String property, String value, int maxlength, Pattern pattern) { if (StringUtils.isEmpty(value)) { - return; + return false; } if (value.length() > maxlength) { logger.error( @@ -800,6 +805,7 @@ public static void checkProperty(String property, String value, int maxlength, P "", "Parameter value format error. Invalid " + property + "=\"" + value + "\" is longer than " + maxlength); + return false; } if (pattern != null) { Matcher matcher = pattern.matcher(value); @@ -811,7 +817,9 @@ public static void checkProperty(String property, String value, int maxlength, P "Parameter value format error. Invalid " + property + "=\"" + value + "\" contains illegal " + "character, only digit, letter, '-', '_' or '.' is legal."); + return false; } } + return true; } } diff --git a/dubbo-config/dubbo-config-api/src/test/java/org/apache/dubbo/config/ReferenceConfigTest.java b/dubbo-config/dubbo-config-api/src/test/java/org/apache/dubbo/config/ReferenceConfigTest.java index 983c19299a2..7b67217e579 100644 --- a/dubbo-config/dubbo-config-api/src/test/java/org/apache/dubbo/config/ReferenceConfigTest.java +++ b/dubbo-config/dubbo-config-api/src/test/java/org/apache/dubbo/config/ReferenceConfigTest.java @@ -873,7 +873,7 @@ void testGenericAndInterfaceConflicts() { referenceConfig.setGeneric("true"); DubboBootstrap.getInstance() - .application("demo app") + .application("demo-app") .reference(referenceConfig) .initialize(); diff --git a/dubbo-config/dubbo-config-api/src/test/java/org/apache/dubbo/config/utils/ConfigValidationUtilsTest.java b/dubbo-config/dubbo-config-api/src/test/java/org/apache/dubbo/config/utils/ConfigValidationUtilsTest.java index fb6dae095c6..5cb5036e697 100644 --- a/dubbo-config/dubbo-config-api/src/test/java/org/apache/dubbo/config/utils/ConfigValidationUtilsTest.java +++ b/dubbo-config/dubbo-config-api/src/test/java/org/apache/dubbo/config/utils/ConfigValidationUtilsTest.java @@ -100,6 +100,9 @@ void testValidateApplicationConfig() throws Exception { mockedStatic .when(() -> ConfigValidationUtils.validateApplicationConfig(any())) .thenCallRealMethod(); + mockedStatic + .when(() -> ConfigValidationUtils.checkName(any(), any())) + .thenReturn(true); ApplicationConfig config = new ApplicationConfig(); Assertions.assertThrows(IllegalStateException.class, () -> { ConfigValidationUtils.validateApplicationConfig(config); From 1d9535518e06aca72c3d2c3df0785b2463a0da91 Mon Sep 17 00:00:00 2001 From: funkye <364176773@qq.com> Date: Sat, 13 Jan 2024 01:48:14 +0800 Subject: [PATCH 20/40] DefaultProviderFirstParams add THREADPOOL_KEY (#13637) * DefaultProviderFirstParams add THREADPOOL_KEY * DefaultProviderFirstParams add THREADPOOL_KEY * DefaultProviderFirstParams add THREADPOOL_KEY * format --- .../registry/support/DefaultProviderFirstParams.java | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/dubbo-registry/dubbo-registry-api/src/main/java/org/apache/dubbo/registry/support/DefaultProviderFirstParams.java b/dubbo-registry/dubbo-registry-api/src/main/java/org/apache/dubbo/registry/support/DefaultProviderFirstParams.java index 0a18f2572a8..70a862f6919 100644 --- a/dubbo-registry/dubbo-registry-api/src/main/java/org/apache/dubbo/registry/support/DefaultProviderFirstParams.java +++ b/dubbo-registry/dubbo-registry-api/src/main/java/org/apache/dubbo/registry/support/DefaultProviderFirstParams.java @@ -24,15 +24,24 @@ import java.util.Set; import static org.apache.dubbo.common.constants.CommonConstants.DUBBO_VERSION_KEY; +import static org.apache.dubbo.common.constants.CommonConstants.EXECUTOR_MANAGEMENT_MODE; import static org.apache.dubbo.common.constants.CommonConstants.METHODS_KEY; import static org.apache.dubbo.common.constants.CommonConstants.RELEASE_KEY; import static org.apache.dubbo.common.constants.CommonConstants.TAG_KEY; +import static org.apache.dubbo.common.constants.CommonConstants.THREADPOOL_KEY; import static org.apache.dubbo.common.constants.CommonConstants.TIMESTAMP_KEY; public class DefaultProviderFirstParams implements ProviderFirstParams { private static final Set PARAMS = Collections.unmodifiableSet(new HashSet() { { - addAll(Arrays.asList(RELEASE_KEY, DUBBO_VERSION_KEY, METHODS_KEY, TIMESTAMP_KEY, TAG_KEY)); + addAll(Arrays.asList( + RELEASE_KEY, + DUBBO_VERSION_KEY, + METHODS_KEY, + TIMESTAMP_KEY, + TAG_KEY, + THREADPOOL_KEY, + EXECUTOR_MANAGEMENT_MODE)); } }); From df0de49b8c19cae9b9d1d1e4f6e3a37111c6f7ec Mon Sep 17 00:00:00 2001 From: huazhongming Date: Sat, 13 Jan 2024 01:58:58 +0800 Subject: [PATCH 21/40] Fix URL parse pwd failed when the pwd contains '#' (#13631) * Fix URL parse pwd failed when the pwd contains # Signed-off-by: crazyhzm * Parse url pwd Signed-off-by: crazyhzm * Fix npe Signed-off-by: crazyhzm * Remove username and pwd from parameter Signed-off-by: crazyhzm * Add ut Signed-off-by: crazyhzm --------- Signed-off-by: crazyhzm --- .../org/apache/dubbo/common/URLStrParser.java | 21 +++++++++++++++---- .../apache/dubbo/common/URLStrParserTest.java | 1 + 2 files changed, 18 insertions(+), 4 deletions(-) diff --git a/dubbo-common/src/main/java/org/apache/dubbo/common/URLStrParser.java b/dubbo-common/src/main/java/org/apache/dubbo/common/URLStrParser.java index 3b1761e2ffb..c8ee6337e4a 100644 --- a/dubbo-common/src/main/java/org/apache/dubbo/common/URLStrParser.java +++ b/dubbo-common/src/main/java/org/apache/dubbo/common/URLStrParser.java @@ -18,12 +18,15 @@ import org.apache.dubbo.common.url.component.ServiceConfigURL; import org.apache.dubbo.common.url.component.URLItemCache; +import org.apache.dubbo.common.utils.StringUtils; import java.util.Collections; import java.util.HashMap; import java.util.Map; import static org.apache.dubbo.common.constants.CommonConstants.DEFAULT_KEY_PREFIX; +import static org.apache.dubbo.common.constants.CommonConstants.PASSWORD_KEY; +import static org.apache.dubbo.common.constants.CommonConstants.USERNAME_KEY; import static org.apache.dubbo.common.utils.StringUtils.EMPTY_STRING; import static org.apache.dubbo.common.utils.StringUtils.decodeHexByte; import static org.apache.dubbo.common.utils.Utf8Utils.decodeUtf8; @@ -42,8 +45,8 @@ private URLStrParser() { } /** - * @param decodedURLStr : after {@link URL#decode} string - * decodedURLStr format: protocol://username:password@host:port/path?k1=v1&k2=v2 + * @param decodedURLStr : after {@link URL#decode} string decodedURLStr format: + * protocol://username:password@host:port/path?k1=v1&k2=v2 * [protocol://][username:password@][host:port]/[path][?k1=v1&k2=v2] */ public static URL parseDecodedStr(String decodedURLStr) { @@ -103,6 +106,7 @@ private static URL parseURLBody(String fullURLStr, String decodedBody, Map parseParams(String rawParams, boolean encoded) } /** - * @param encodedURLStr : after {@link URL#encode(String)} string - * encodedURLStr after decode format: protocol://username:password@host:port/path?k1=v1&k2=v2 + * @param encodedURLStr : after {@link URL#encode(String)} string encodedURLStr after decode format: + * protocol://username:password@host:port/path?k1=v1&k2=v2 * [protocol://][username:password@][host:port]/[path][?k1=v1&k2=v2] */ public static URL parseEncodedStr(String encodedURLStr) { diff --git a/dubbo-common/src/test/java/org/apache/dubbo/common/URLStrParserTest.java b/dubbo-common/src/test/java/org/apache/dubbo/common/URLStrParserTest.java index 4c4c218c35c..01364faab9e 100644 --- a/dubbo-common/src/test/java/org/apache/dubbo/common/URLStrParserTest.java +++ b/dubbo-common/src/test/java/org/apache/dubbo/common/URLStrParserTest.java @@ -48,6 +48,7 @@ class URLStrParserTest { testCases.add("nacos://192.168.1.1:8848?username=&password="); testCases.add("dubbo://127.0.0.1?timeout=1234&default.timeout=5678"); testCases.add("dubbo://127.0.0.1?default.timeout=5678"); + testCases.add("zookeeper://test10.301.216.302:2181?username=t1#&password=t2#"); errorDecodedCases.add("dubbo:192.168.1.1"); errorDecodedCases.add("://192.168.1.1"); From 16cdc5290e65af9db528470f7f7f51657dd61939 Mon Sep 17 00:00:00 2001 From: kimmking Date: Sat, 13 Jan 2024 02:38:51 +0800 Subject: [PATCH 22/40] Revert "Fix URL parse pwd failed when the pwd contains '#'" (#13645) --- .../org/apache/dubbo/common/URLStrParser.java | 21 ++++--------------- .../apache/dubbo/common/URLStrParserTest.java | 1 - 2 files changed, 4 insertions(+), 18 deletions(-) diff --git a/dubbo-common/src/main/java/org/apache/dubbo/common/URLStrParser.java b/dubbo-common/src/main/java/org/apache/dubbo/common/URLStrParser.java index c8ee6337e4a..3b1761e2ffb 100644 --- a/dubbo-common/src/main/java/org/apache/dubbo/common/URLStrParser.java +++ b/dubbo-common/src/main/java/org/apache/dubbo/common/URLStrParser.java @@ -18,15 +18,12 @@ import org.apache.dubbo.common.url.component.ServiceConfigURL; import org.apache.dubbo.common.url.component.URLItemCache; -import org.apache.dubbo.common.utils.StringUtils; import java.util.Collections; import java.util.HashMap; import java.util.Map; import static org.apache.dubbo.common.constants.CommonConstants.DEFAULT_KEY_PREFIX; -import static org.apache.dubbo.common.constants.CommonConstants.PASSWORD_KEY; -import static org.apache.dubbo.common.constants.CommonConstants.USERNAME_KEY; import static org.apache.dubbo.common.utils.StringUtils.EMPTY_STRING; import static org.apache.dubbo.common.utils.StringUtils.decodeHexByte; import static org.apache.dubbo.common.utils.Utf8Utils.decodeUtf8; @@ -45,8 +42,8 @@ private URLStrParser() { } /** - * @param decodedURLStr : after {@link URL#decode} string decodedURLStr format: - * protocol://username:password@host:port/path?k1=v1&k2=v2 + * @param decodedURLStr : after {@link URL#decode} string + * decodedURLStr format: protocol://username:password@host:port/path?k1=v1&k2=v2 * [protocol://][username:password@][host:port]/[path][?k1=v1&k2=v2] */ public static URL parseDecodedStr(String decodedURLStr) { @@ -106,7 +103,6 @@ private static URL parseURLBody(String fullURLStr, String decodedBody, Map parseParams(String rawParams, boolean encoded) } /** - * @param encodedURLStr : after {@link URL#encode(String)} string encodedURLStr after decode format: - * protocol://username:password@host:port/path?k1=v1&k2=v2 + * @param encodedURLStr : after {@link URL#encode(String)} string + * encodedURLStr after decode format: protocol://username:password@host:port/path?k1=v1&k2=v2 * [protocol://][username:password@][host:port]/[path][?k1=v1&k2=v2] */ public static URL parseEncodedStr(String encodedURLStr) { diff --git a/dubbo-common/src/test/java/org/apache/dubbo/common/URLStrParserTest.java b/dubbo-common/src/test/java/org/apache/dubbo/common/URLStrParserTest.java index 01364faab9e..4c4c218c35c 100644 --- a/dubbo-common/src/test/java/org/apache/dubbo/common/URLStrParserTest.java +++ b/dubbo-common/src/test/java/org/apache/dubbo/common/URLStrParserTest.java @@ -48,7 +48,6 @@ class URLStrParserTest { testCases.add("nacos://192.168.1.1:8848?username=&password="); testCases.add("dubbo://127.0.0.1?timeout=1234&default.timeout=5678"); testCases.add("dubbo://127.0.0.1?default.timeout=5678"); - testCases.add("zookeeper://test10.301.216.302:2181?username=t1#&password=t2#"); errorDecodedCases.add("dubbo:192.168.1.1"); errorDecodedCases.add("://192.168.1.1"); From 1cd57821df6f17b498ab784b0b1f46b958ecf81f Mon Sep 17 00:00:00 2001 From: Albumen Kevin Date: Sat, 13 Jan 2024 18:12:45 +0800 Subject: [PATCH 23/40] Revert "check application name" (#13647) --- .../config/utils/ConfigValidationUtils.java | 18 +++++------------- .../dubbo/config/ReferenceConfigTest.java | 2 +- .../utils/ConfigValidationUtilsTest.java | 3 --- 3 files changed, 6 insertions(+), 17 deletions(-) diff --git a/dubbo-config/dubbo-config-api/src/main/java/org/apache/dubbo/config/utils/ConfigValidationUtils.java b/dubbo-config/dubbo-config-api/src/main/java/org/apache/dubbo/config/utils/ConfigValidationUtils.java index afa057ae7f0..728aa218450 100644 --- a/dubbo-config/dubbo-config-api/src/main/java/org/apache/dubbo/config/utils/ConfigValidationUtils.java +++ b/dubbo-config/dubbo-config-api/src/main/java/org/apache/dubbo/config/utils/ConfigValidationUtils.java @@ -491,12 +491,6 @@ public static void validateApplicationConfig(ApplicationConfig config) { + "Please add to your spring config."); } - String name = config.getName(); - if (!checkName(NAME, name)) { - throw new IllegalStateException( - String.format("please correct dubbo application name: %s at your spring config.", name)); - } - // backward compatibility ScopeModel scopeModel = ScopeModelUtil.getOrDefaultApplicationModel(config.getScopeModel()); PropertiesConfiguration configuration = scopeModel.modelEnvironment().getPropertiesConfiguration(); @@ -510,6 +504,7 @@ public static void validateApplicationConfig(ApplicationConfig config) { } } + checkName(NAME, config.getName()); checkMultiName(OWNER, config.getOwner()); checkName(ORGANIZATION, config.getOrganization()); checkName(ARCHITECTURE, config.getArchitecture()); @@ -737,8 +732,8 @@ public static void checkPathLength(String property, String value) { checkProperty(property, value, MAX_PATH_LENGTH, null); } - public static boolean checkName(String property, String value) { - return checkProperty(property, value, MAX_LENGTH, PATTERN_NAME); + public static void checkName(String property, String value) { + checkProperty(property, value, MAX_LENGTH, PATTERN_NAME); } public static void checkHost(String property, String value) { @@ -794,9 +789,9 @@ public static void checkParameterName(Map parameters) { } } - public static boolean checkProperty(String property, String value, int maxlength, Pattern pattern) { + public static void checkProperty(String property, String value, int maxlength, Pattern pattern) { if (StringUtils.isEmpty(value)) { - return false; + return; } if (value.length() > maxlength) { logger.error( @@ -805,7 +800,6 @@ public static boolean checkProperty(String property, String value, int maxlength "", "Parameter value format error. Invalid " + property + "=\"" + value + "\" is longer than " + maxlength); - return false; } if (pattern != null) { Matcher matcher = pattern.matcher(value); @@ -817,9 +811,7 @@ public static boolean checkProperty(String property, String value, int maxlength "Parameter value format error. Invalid " + property + "=\"" + value + "\" contains illegal " + "character, only digit, letter, '-', '_' or '.' is legal."); - return false; } } - return true; } } diff --git a/dubbo-config/dubbo-config-api/src/test/java/org/apache/dubbo/config/ReferenceConfigTest.java b/dubbo-config/dubbo-config-api/src/test/java/org/apache/dubbo/config/ReferenceConfigTest.java index 7b67217e579..983c19299a2 100644 --- a/dubbo-config/dubbo-config-api/src/test/java/org/apache/dubbo/config/ReferenceConfigTest.java +++ b/dubbo-config/dubbo-config-api/src/test/java/org/apache/dubbo/config/ReferenceConfigTest.java @@ -873,7 +873,7 @@ void testGenericAndInterfaceConflicts() { referenceConfig.setGeneric("true"); DubboBootstrap.getInstance() - .application("demo-app") + .application("demo app") .reference(referenceConfig) .initialize(); diff --git a/dubbo-config/dubbo-config-api/src/test/java/org/apache/dubbo/config/utils/ConfigValidationUtilsTest.java b/dubbo-config/dubbo-config-api/src/test/java/org/apache/dubbo/config/utils/ConfigValidationUtilsTest.java index 5cb5036e697..fb6dae095c6 100644 --- a/dubbo-config/dubbo-config-api/src/test/java/org/apache/dubbo/config/utils/ConfigValidationUtilsTest.java +++ b/dubbo-config/dubbo-config-api/src/test/java/org/apache/dubbo/config/utils/ConfigValidationUtilsTest.java @@ -100,9 +100,6 @@ void testValidateApplicationConfig() throws Exception { mockedStatic .when(() -> ConfigValidationUtils.validateApplicationConfig(any())) .thenCallRealMethod(); - mockedStatic - .when(() -> ConfigValidationUtils.checkName(any(), any())) - .thenReturn(true); ApplicationConfig config = new ApplicationConfig(); Assertions.assertThrows(IllegalStateException.class, () -> { ConfigValidationUtils.validateApplicationConfig(config); From 714e0762844c0a227255171e467b6b1d963043c3 Mon Sep 17 00:00:00 2001 From: Albumen Kevin Date: Sat, 13 Jan 2024 18:16:49 +0800 Subject: [PATCH 24/40] Revert "DefaultProviderFirstParams add THREADPOOL_KEY" (#13648) --- .../registry/support/DefaultProviderFirstParams.java | 11 +---------- 1 file changed, 1 insertion(+), 10 deletions(-) diff --git a/dubbo-registry/dubbo-registry-api/src/main/java/org/apache/dubbo/registry/support/DefaultProviderFirstParams.java b/dubbo-registry/dubbo-registry-api/src/main/java/org/apache/dubbo/registry/support/DefaultProviderFirstParams.java index 70a862f6919..0a18f2572a8 100644 --- a/dubbo-registry/dubbo-registry-api/src/main/java/org/apache/dubbo/registry/support/DefaultProviderFirstParams.java +++ b/dubbo-registry/dubbo-registry-api/src/main/java/org/apache/dubbo/registry/support/DefaultProviderFirstParams.java @@ -24,24 +24,15 @@ import java.util.Set; import static org.apache.dubbo.common.constants.CommonConstants.DUBBO_VERSION_KEY; -import static org.apache.dubbo.common.constants.CommonConstants.EXECUTOR_MANAGEMENT_MODE; import static org.apache.dubbo.common.constants.CommonConstants.METHODS_KEY; import static org.apache.dubbo.common.constants.CommonConstants.RELEASE_KEY; import static org.apache.dubbo.common.constants.CommonConstants.TAG_KEY; -import static org.apache.dubbo.common.constants.CommonConstants.THREADPOOL_KEY; import static org.apache.dubbo.common.constants.CommonConstants.TIMESTAMP_KEY; public class DefaultProviderFirstParams implements ProviderFirstParams { private static final Set PARAMS = Collections.unmodifiableSet(new HashSet() { { - addAll(Arrays.asList( - RELEASE_KEY, - DUBBO_VERSION_KEY, - METHODS_KEY, - TIMESTAMP_KEY, - TAG_KEY, - THREADPOOL_KEY, - EXECUTOR_MANAGEMENT_MODE)); + addAll(Arrays.asList(RELEASE_KEY, DUBBO_VERSION_KEY, METHODS_KEY, TIMESTAMP_KEY, TAG_KEY)); } }); From ac076eed4a0d83d64b34aee42bbc79c414371e1b Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Wed, 17 Jan 2024 16:38:50 +0800 Subject: [PATCH 25/40] Bump org.apache.maven.plugins:maven-failsafe-plugin from 3.2.3 to 3.2.5 (#13664) Bumps [org.apache.maven.plugins:maven-failsafe-plugin](https://github.com/apache/maven-surefire) from 3.2.3 to 3.2.5. - [Release notes](https://github.com/apache/maven-surefire/releases) - [Commits](https://github.com/apache/maven-surefire/compare/surefire-3.2.3...surefire-3.2.5) --- updated-dependencies: - dependency-name: org.apache.maven.plugins:maven-failsafe-plugin dependency-type: direct:production update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pom.xml b/pom.xml index c905756d098..ce059cc6e87 100644 --- a/pom.xml +++ b/pom.xml @@ -143,7 +143,7 @@ 3.3.0 3.2.3 - 3.2.3 + 3.2.5 2.8.2 3.12.1 3.3.0 From 867ebc5e11f0afdf4454f146c610ea69ba391823 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Wed, 17 Jan 2024 16:38:59 +0800 Subject: [PATCH 26/40] Bump io.opentelemetry:opentelemetry-bom from 1.34.0 to 1.34.1 (#13663) Bumps [io.opentelemetry:opentelemetry-bom](https://github.com/open-telemetry/opentelemetry-java) from 1.34.0 to 1.34.1. - [Release notes](https://github.com/open-telemetry/opentelemetry-java/releases) - [Changelog](https://github.com/open-telemetry/opentelemetry-java/blob/main/CHANGELOG.md) - [Commits](https://github.com/open-telemetry/opentelemetry-java/compare/v1.34.0...v1.34.1) --- updated-dependencies: - dependency-name: io.opentelemetry:opentelemetry-bom dependency-type: direct:production update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- .../dubbo-spring-boot-starters/observability/pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/dubbo-spring-boot/dubbo-spring-boot-starters/observability/pom.xml b/dubbo-spring-boot/dubbo-spring-boot-starters/observability/pom.xml index a9b09df3e8a..cce099e48c2 100644 --- a/dubbo-spring-boot/dubbo-spring-boot-starters/observability/pom.xml +++ b/dubbo-spring-boot/dubbo-spring-boot-starters/observability/pom.xml @@ -38,7 +38,7 @@ 1.12.1 1.2.1 - 1.34.0 + 1.34.1 2.17.2 0.16.0 From f0782a4e805ec9a0c06de66ad9d6491bda1acbfc Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Wed, 17 Jan 2024 16:39:20 +0800 Subject: [PATCH 27/40] Bump io.projectreactor:reactor-core from 3.6.1 to 3.6.2 (#13660) Bumps [io.projectreactor:reactor-core](https://github.com/reactor/reactor-core) from 3.6.1 to 3.6.2. - [Release notes](https://github.com/reactor/reactor-core/releases) - [Commits](https://github.com/reactor/reactor-core/compare/v3.6.1...v3.6.2) --- updated-dependencies: - dependency-name: io.projectreactor:reactor-core dependency-type: direct:development update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- dubbo-dependencies-bom/pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/dubbo-dependencies-bom/pom.xml b/dubbo-dependencies-bom/pom.xml index 21c48a7c51e..129a7fa56c8 100644 --- a/dubbo-dependencies-bom/pom.xml +++ b/dubbo-dependencies-bom/pom.xml @@ -125,7 +125,7 @@ 3.3 0.16.0 1.0.4 - 3.6.1 + 3.6.2 2.2.21 3.14.9 From 1bc3deee13282ff6d7d63be1826a8e8e80658b0d Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Wed, 17 Jan 2024 16:39:32 +0800 Subject: [PATCH 28/40] Bump org.apache.tomcat.embed:tomcat-embed-core from 8.5.97 to 8.5.98 (#13657) Bumps org.apache.tomcat.embed:tomcat-embed-core from 8.5.97 to 8.5.98. --- updated-dependencies: - dependency-name: org.apache.tomcat.embed:tomcat-embed-core dependency-type: direct:development update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- dubbo-dependencies-bom/pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/dubbo-dependencies-bom/pom.xml b/dubbo-dependencies-bom/pom.xml index 129a7fa56c8..4822d9560c5 100644 --- a/dubbo-dependencies-bom/pom.xml +++ b/dubbo-dependencies-bom/pom.xml @@ -132,7 +132,7 @@ 2.1.1 3.15.6.Final 1.9.13 - 8.5.97 + 8.5.98 2.2.4 1.60.1 0.8.1 From 986879e7b2cb1bcd8f120318097af6c40d4ef588 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Wed, 17 Jan 2024 16:39:41 +0800 Subject: [PATCH 29/40] Bump protobuf-java_version from 3.25.1 to 3.25.2 (#13654) Bumps `protobuf-java_version` from 3.25.1 to 3.25.2. Updates `com.google.protobuf:protobuf-java` from 3.25.1 to 3.25.2 - [Release notes](https://github.com/protocolbuffers/protobuf/releases) - [Changelog](https://github.com/protocolbuffers/protobuf/blob/main/protobuf_release.bzl) - [Commits](https://github.com/protocolbuffers/protobuf/compare/v3.25.1...v3.25.2) Updates `com.google.protobuf:protobuf-java-util` from 3.25.1 to 3.25.2 --- updated-dependencies: - dependency-name: com.google.protobuf:protobuf-java dependency-type: direct:development update-type: version-update:semver-patch - dependency-name: com.google.protobuf:protobuf-java-util dependency-type: direct:production update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- dubbo-dependencies-bom/pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/dubbo-dependencies-bom/pom.xml b/dubbo-dependencies-bom/pom.xml index 4822d9560c5..7272aa8d0af 100644 --- a/dubbo-dependencies-bom/pom.xml +++ b/dubbo-dependencies-bom/pom.xml @@ -105,7 +105,7 @@ 2.12.0 3.10.0 4.0.66 - 3.25.1 + 3.25.2 1.3.2 3.1.0 9.4.53.v20231009 From 4eb1bb970f129dfd28977955a377836fdf7fb84d Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Wed, 17 Jan 2024 16:39:49 +0800 Subject: [PATCH 30/40] Bump com.diffplug.spotless:spotless-maven-plugin from 2.41.1 to 2.42.0 (#13659) Bumps [com.diffplug.spotless:spotless-maven-plugin](https://github.com/diffplug/spotless) from 2.41.1 to 2.42.0. - [Changelog](https://github.com/diffplug/spotless/blob/main/CHANGES.md) - [Commits](https://github.com/diffplug/spotless/compare/maven/2.41.1...lib/2.42.0) --- updated-dependencies: - dependency-name: com.diffplug.spotless:spotless-maven-plugin dependency-type: direct:production update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- dubbo-build-tools/pom.xml | 2 +- dubbo-dependencies-bom/pom.xml | 2 +- .../dubbo-dependencies-zookeeper-curator5/pom.xml | 2 +- dubbo-dependencies/dubbo-dependencies-zookeeper/pom.xml | 2 +- dubbo-dependencies/pom.xml | 2 +- dubbo-distribution/pom.xml | 2 +- pom.xml | 2 +- 7 files changed, 7 insertions(+), 7 deletions(-) diff --git a/dubbo-build-tools/pom.xml b/dubbo-build-tools/pom.xml index bb8a65d81db..990028412cf 100644 --- a/dubbo-build-tools/pom.xml +++ b/dubbo-build-tools/pom.xml @@ -23,7 +23,7 @@ true - 2.41.1 + 2.42.0 check 1.0.0 2.38.0 diff --git a/dubbo-dependencies-bom/pom.xml b/dubbo-dependencies-bom/pom.xml index 7272aa8d0af..d50faf58e9d 100644 --- a/dubbo-dependencies-bom/pom.xml +++ b/dubbo-dependencies-bom/pom.xml @@ -166,7 +166,7 @@ 2.0 1.5.0 1.25.0 - 2.41.1 + 2.42.0 check 1.0.0 2.38.0 diff --git a/dubbo-dependencies/dubbo-dependencies-zookeeper-curator5/pom.xml b/dubbo-dependencies/dubbo-dependencies-zookeeper-curator5/pom.xml index 5317adbf1bc..6a168f628e7 100644 --- a/dubbo-dependencies/dubbo-dependencies-zookeeper-curator5/pom.xml +++ b/dubbo-dependencies/dubbo-dependencies-zookeeper-curator5/pom.xml @@ -35,7 +35,7 @@ 1.5.0 5.1.0 3.8.3 - 2.41.1 + 2.42.0 check 1.0.0 2.38.0 diff --git a/dubbo-dependencies/dubbo-dependencies-zookeeper/pom.xml b/dubbo-dependencies/dubbo-dependencies-zookeeper/pom.xml index ccb93a3e266..98893e2b09a 100644 --- a/dubbo-dependencies/dubbo-dependencies-zookeeper/pom.xml +++ b/dubbo-dependencies/dubbo-dependencies-zookeeper/pom.xml @@ -35,7 +35,7 @@ 1.5.0 4.3.0 3.4.14 - 2.41.1 + 2.42.0 check 1.0.0 2.38.0 diff --git a/dubbo-dependencies/pom.xml b/dubbo-dependencies/pom.xml index 937fdb8fa07..feb18276b30 100644 --- a/dubbo-dependencies/pom.xml +++ b/dubbo-dependencies/pom.xml @@ -32,7 +32,7 @@ - 2.41.1 + 2.42.0 check 1.0.0 2.38.0 diff --git a/dubbo-distribution/pom.xml b/dubbo-distribution/pom.xml index ef6959e1cdf..7a6838b4fb5 100644 --- a/dubbo-distribution/pom.xml +++ b/dubbo-distribution/pom.xml @@ -28,7 +28,7 @@ pom - 2.41.1 + 2.42.0 check 1.0.0 2.38.0 diff --git a/pom.xml b/pom.xml index ce059cc6e87..bedcd9cd910 100644 --- a/pom.xml +++ b/pom.xml @@ -165,7 +165,7 @@ 1.2.2 3.22.3 1.54.0 - 2.41.1 + 2.42.0 check 1.0.0 2.38.0 From 7bc2e1770691e631c9d8e0b63fd241e1e481f21d Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Wed, 17 Jan 2024 16:39:58 +0800 Subject: [PATCH 31/40] Bump org.codehaus.mojo:flatten-maven-plugin from 1.5.0 to 1.6.0 (#13656) Bumps [org.codehaus.mojo:flatten-maven-plugin](https://github.com/mojohaus/flatten-maven-plugin) from 1.5.0 to 1.6.0. - [Release notes](https://github.com/mojohaus/flatten-maven-plugin/releases) - [Commits](https://github.com/mojohaus/flatten-maven-plugin/compare/1.5.0...1.6.0) --- updated-dependencies: - dependency-name: org.codehaus.mojo:flatten-maven-plugin dependency-type: direct:production update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- dubbo-dependencies-bom/pom.xml | 2 +- .../dubbo-dependencies-zookeeper-curator5/pom.xml | 2 +- dubbo-dependencies/dubbo-dependencies-zookeeper/pom.xml | 2 +- pom.xml | 2 +- 4 files changed, 4 insertions(+), 4 deletions(-) diff --git a/dubbo-dependencies-bom/pom.xml b/dubbo-dependencies-bom/pom.xml index d50faf58e9d..c219daf39e6 100644 --- a/dubbo-dependencies-bom/pom.xml +++ b/dubbo-dependencies-bom/pom.xml @@ -164,7 +164,7 @@ 2.16.1 6.1.26 2.0 - 1.5.0 + 1.6.0 1.25.0 2.42.0 check diff --git a/dubbo-dependencies/dubbo-dependencies-zookeeper-curator5/pom.xml b/dubbo-dependencies/dubbo-dependencies-zookeeper-curator5/pom.xml index 6a168f628e7..5ae0066ef01 100644 --- a/dubbo-dependencies/dubbo-dependencies-zookeeper-curator5/pom.xml +++ b/dubbo-dependencies/dubbo-dependencies-zookeeper-curator5/pom.xml @@ -32,7 +32,7 @@ 3.2.11-SNAPSHOT - 1.5.0 + 1.6.0 5.1.0 3.8.3 2.42.0 diff --git a/dubbo-dependencies/dubbo-dependencies-zookeeper/pom.xml b/dubbo-dependencies/dubbo-dependencies-zookeeper/pom.xml index 98893e2b09a..de82fdf2196 100644 --- a/dubbo-dependencies/dubbo-dependencies-zookeeper/pom.xml +++ b/dubbo-dependencies/dubbo-dependencies-zookeeper/pom.xml @@ -32,7 +32,7 @@ 3.2.11-SNAPSHOT - 1.5.0 + 1.6.0 4.3.0 3.4.14 2.42.0 diff --git a/pom.xml b/pom.xml index bedcd9cd910..33e0d6a9913 100644 --- a/pom.xml +++ b/pom.xml @@ -151,7 +151,7 @@ 9.4.53.v20231009 3.3.1 0.8.11 - 1.5.0 + 1.6.0 3.4.1 3.1.0 1.7.1 From 0433ef3589fa88e1b7cfb6c026bc7becde85b3d5 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Wed, 17 Jan 2024 16:40:04 +0800 Subject: [PATCH 32/40] Bump grpc.version from 1.60.1 to 1.61.0 (#13652) Bumps `grpc.version` from 1.60.1 to 1.61.0. Updates `io.grpc:grpc-core` from 1.60.1 to 1.61.0 - [Release notes](https://github.com/grpc/grpc-java/releases) - [Commits](https://github.com/grpc/grpc-java/compare/v1.60.1...v1.61.0) Updates `io.grpc:grpc-stub` from 1.60.1 to 1.61.0 - [Release notes](https://github.com/grpc/grpc-java/releases) - [Commits](https://github.com/grpc/grpc-java/compare/v1.60.1...v1.61.0) Updates `io.grpc:grpc-protobuf` from 1.60.1 to 1.61.0 - [Release notes](https://github.com/grpc/grpc-java/releases) - [Commits](https://github.com/grpc/grpc-java/compare/v1.60.1...v1.61.0) Updates `io.grpc:grpc-context` from 1.60.1 to 1.61.0 - [Release notes](https://github.com/grpc/grpc-java/releases) - [Commits](https://github.com/grpc/grpc-java/compare/v1.60.1...v1.61.0) Updates `io.grpc:grpc-netty-shaded` from 1.60.1 to 1.61.0 - [Release notes](https://github.com/grpc/grpc-java/releases) - [Commits](https://github.com/grpc/grpc-java/compare/v1.60.1...v1.61.0) Updates `io.grpc:grpc-netty` from 1.60.1 to 1.61.0 - [Release notes](https://github.com/grpc/grpc-java/releases) - [Commits](https://github.com/grpc/grpc-java/compare/v1.60.1...v1.61.0) Updates `io.grpc:grpc-grpclb` from 1.60.1 to 1.61.0 - [Release notes](https://github.com/grpc/grpc-java/releases) - [Commits](https://github.com/grpc/grpc-java/compare/v1.60.1...v1.61.0) --- updated-dependencies: - dependency-name: io.grpc:grpc-core dependency-type: direct:production update-type: version-update:semver-minor - dependency-name: io.grpc:grpc-stub dependency-type: direct:production update-type: version-update:semver-minor - dependency-name: io.grpc:grpc-protobuf dependency-type: direct:production update-type: version-update:semver-minor - dependency-name: io.grpc:grpc-context dependency-type: direct:production update-type: version-update:semver-minor - dependency-name: io.grpc:grpc-netty-shaded dependency-type: direct:production update-type: version-update:semver-minor - dependency-name: io.grpc:grpc-netty dependency-type: direct:production update-type: version-update:semver-minor - dependency-name: io.grpc:grpc-grpclb dependency-type: direct:production update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- dubbo-dependencies-bom/pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/dubbo-dependencies-bom/pom.xml b/dubbo-dependencies-bom/pom.xml index c219daf39e6..46e23bd2cd3 100644 --- a/dubbo-dependencies-bom/pom.xml +++ b/dubbo-dependencies-bom/pom.xml @@ -134,7 +134,7 @@ 1.9.13 8.5.98 2.2.4 - 1.60.1 + 1.61.0 0.8.1 1.2.2 From 9e518419592e55faac062744f4ff5d72cd7afff3 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Wed, 17 Jan 2024 16:40:13 +0800 Subject: [PATCH 33/40] Bump org.apache.maven.plugin-tools:maven-plugin-annotations (#13658) Bumps [org.apache.maven.plugin-tools:maven-plugin-annotations](https://github.com/apache/maven-plugin-tools) from 3.10.2 to 3.11.0. - [Release notes](https://github.com/apache/maven-plugin-tools/releases) - [Commits](https://github.com/apache/maven-plugin-tools/compare/maven-plugin-tools-3.10.2...maven-plugin-tools-3.11.0) --- updated-dependencies: - dependency-name: org.apache.maven.plugin-tools:maven-plugin-annotations dependency-type: direct:production update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- dubbo-maven-plugin/pom.xml | 2 +- dubbo-native-plugin/pom.xml | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/dubbo-maven-plugin/pom.xml b/dubbo-maven-plugin/pom.xml index c5526a6a0f7..78c3b37e226 100644 --- a/dubbo-maven-plugin/pom.xml +++ b/dubbo-maven-plugin/pom.xml @@ -46,7 +46,7 @@ org.apache.maven.plugin-tools maven-plugin-annotations - 3.10.2 + 3.11.0 provided diff --git a/dubbo-native-plugin/pom.xml b/dubbo-native-plugin/pom.xml index 95cd04e0acf..a3b847c1daf 100644 --- a/dubbo-native-plugin/pom.xml +++ b/dubbo-native-plugin/pom.xml @@ -48,7 +48,7 @@ org.apache.maven.plugin-tools maven-plugin-annotations - 3.10.2 + 3.11.0 provided From ac9cafbf53487821c74146fbfd03ac89fc17ad12 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Wed, 17 Jan 2024 16:40:20 +0800 Subject: [PATCH 34/40] Bump io.micrometer:micrometer-core from 1.12.1 to 1.12.2 (#13653) Bumps [io.micrometer:micrometer-core](https://github.com/micrometer-metrics/micrometer) from 1.12.1 to 1.12.2. - [Release notes](https://github.com/micrometer-metrics/micrometer/releases) - [Commits](https://github.com/micrometer-metrics/micrometer/compare/v1.12.1...v1.12.2) --- updated-dependencies: - dependency-name: io.micrometer:micrometer-core dependency-type: direct:production update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- dubbo-demo/dubbo-demo-spring-boot/pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/dubbo-demo/dubbo-demo-spring-boot/pom.xml b/dubbo-demo/dubbo-demo-spring-boot/pom.xml index 8101a0bc26e..9dbb5ac36fd 100644 --- a/dubbo-demo/dubbo-demo-spring-boot/pom.xml +++ b/dubbo-demo/dubbo-demo-spring-boot/pom.xml @@ -37,7 +37,7 @@ true 2.7.18 2.7.18 - 1.12.1 + 1.12.2 From 3d5edbbb5711bd1ab188647afb575a250f136afd Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Wed, 17 Jan 2024 16:40:36 +0800 Subject: [PATCH 35/40] Bump io.micrometer:micrometer-tracing-bom from 1.2.1 to 1.2.2 (#13651) Bumps [io.micrometer:micrometer-tracing-bom](https://github.com/micrometer-metrics/tracing) from 1.2.1 to 1.2.2. - [Release notes](https://github.com/micrometer-metrics/tracing/releases) - [Commits](https://github.com/micrometer-metrics/tracing/compare/v1.2.1...v1.2.2) --- updated-dependencies: - dependency-name: io.micrometer:micrometer-tracing-bom dependency-type: direct:production update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- dubbo-dependencies-bom/pom.xml | 2 +- .../dubbo-spring-boot-starters/observability/pom.xml | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/dubbo-dependencies-bom/pom.xml b/dubbo-dependencies-bom/pom.xml index 46e23bd2cd3..609096cc21e 100644 --- a/dubbo-dependencies-bom/pom.xml +++ b/dubbo-dependencies-bom/pom.xml @@ -121,7 +121,7 @@ 0.1.35 1.12.1 - 1.2.1 + 1.2.2 3.3 0.16.0 1.0.4 diff --git a/dubbo-spring-boot/dubbo-spring-boot-starters/observability/pom.xml b/dubbo-spring-boot/dubbo-spring-boot-starters/observability/pom.xml index cce099e48c2..191f2d42f1d 100644 --- a/dubbo-spring-boot/dubbo-spring-boot-starters/observability/pom.xml +++ b/dubbo-spring-boot/dubbo-spring-boot-starters/observability/pom.xml @@ -37,7 +37,7 @@ 1.12.1 - 1.2.1 + 1.2.2 1.34.1 2.17.2 0.16.0 From 9d37c4e08310576e4a8032b9bd02bf7c6493365e Mon Sep 17 00:00:00 2001 From: Albumen Kevin Date: Wed, 17 Jan 2024 16:55:23 +0800 Subject: [PATCH 36/40] Add pond test cases (#13646) --- .../apache/dubbo/common/URLStrParserTest.java | 24 +++++++++++++++---- 1 file changed, 20 insertions(+), 4 deletions(-) diff --git a/dubbo-common/src/test/java/org/apache/dubbo/common/URLStrParserTest.java b/dubbo-common/src/test/java/org/apache/dubbo/common/URLStrParserTest.java index 4c4c218c35c..a16c5f9e198 100644 --- a/dubbo-common/src/test/java/org/apache/dubbo/common/URLStrParserTest.java +++ b/dubbo-common/src/test/java/org/apache/dubbo/common/URLStrParserTest.java @@ -38,8 +38,11 @@ class URLStrParserTest { testCases.add("dubbo://192.168.1.1"); testCases.add("dubbo://192.168.1.1?"); testCases.add("dubbo://127.0.0.1?test=中文测试"); - testCases.add( - "dubbo://admin:admin123@192.168.1.41:28113/org.test.api.DemoService$Iface?anyhost=true&application=demo-service&dubbo=2.6.1&generic=false&interface=org.test.api.DemoService$Iface&methods=orbCompare,checkText,checkPicture&pid=65557&revision=1.4.17&service.filter=bootMetrics&side=provider&status=server&threads=200×tamp=1583136298859&version=1.0.0"); + testCases.add("dubbo://admin:admin123@192.168.1.41:28113/org.test.api" + + ".DemoService$Iface?anyhost=true&application=demo-service&dubbo=2.6.1&generic=false&interface=org" + + ".test.api.DemoService$Iface&methods=orbCompare,checkText,checkPicture&pid=65557&revision=1.4" + + ".17&service.filter=bootMetrics&side=provider&status=server&threads=200×tamp=1583136298859" + + "&version=1.0.0"); // super long text test testCases.add("dubbo://192.168.1.1/" + RandomString.make(10240)); testCases.add("file:/path/to/file.txt"); @@ -57,8 +60,8 @@ class URLStrParserTest { errorEncodedCases.add("dubbo%3a192.168.1.1%3fabc%3dabc"); errorEncodedCases.add("%3a%2f%2f192.168.1.1%3fabc%3dabc"); errorEncodedCases.add("%3a%2f192.168.1.1%3fabc%3dabc"); - errorEncodedCases.add( - "dubbo%3a%2f%2f127.0.0.1%3ftest%3d%e2%96%b2%e2%96%bc%e2%97%80%e2%96%b6%e2%86%90%e2%86%91%e2%86%92%e2%86%93%e2%86%94%e2%86%95%e2%88%9e%c2%b1%e9%be%98%e9%9d%90%e9%bd%89%9%d%b"); + errorEncodedCases.add("dubbo%3a%2f%2f127.0.0.1%3ftest%3d%e2%96%b2%e2%96%bc%e2%97%80%e2%96%b6%e2%86%90%e2%86" + + "%91%e2%86%92%e2%86%93%e2%86%94%e2%86%95%e2%88%9e%c2%b1%e9%be%98%e9%9d%90%e9%bd%89%9%d%b"); } @Test @@ -93,4 +96,17 @@ void testDefault() { assertThat(url2.getParameter("timeout"), equalTo("5678")); assertThat(url2.getParameter("default.timeout"), equalTo("5678")); } + + @Test + void testPond() { + String str = "https://a#@b"; + + URL url1 = URL.valueOf(str); + URL url2 = URLStrParser.parseDecodedStr(str); + + Assertions.assertEquals("https", url1.getProtocol()); + Assertions.assertEquals("https", url2.getProtocol()); + Assertions.assertEquals("a", url1.getHost()); + Assertions.assertEquals("a", url2.getHost()); + } } From 8f5b5c6a7b9c41ac481ec4b26238fe984782ac1f Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Wed, 17 Jan 2024 17:29:06 +0800 Subject: [PATCH 37/40] Bump org.apache.maven.plugins:maven-surefire-plugin from 3.2.3 to 3.2.5 (#13661) Bumps [org.apache.maven.plugins:maven-surefire-plugin](https://github.com/apache/maven-surefire) from 3.2.3 to 3.2.5. - [Release notes](https://github.com/apache/maven-surefire/releases) - [Commits](https://github.com/apache/maven-surefire/compare/surefire-3.2.3...surefire-3.2.5) --- updated-dependencies: - dependency-name: org.apache.maven.plugins:maven-surefire-plugin dependency-type: direct:production update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pom.xml b/pom.xml index 33e0d6a9913..caf0ac268a1 100644 --- a/pom.xml +++ b/pom.xml @@ -142,7 +142,7 @@ UTF-8 3.3.0 - 3.2.3 + 3.2.5 3.2.5 2.8.2 3.12.1 From 66710126b73f7c9ee91ef0b030780a665d53673e Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Wed, 17 Jan 2024 17:40:53 +0800 Subject: [PATCH 38/40] Bump io.micrometer:micrometer-bom from 1.12.1 to 1.12.2 (#13662) Bumps [io.micrometer:micrometer-bom](https://github.com/micrometer-metrics/micrometer) from 1.12.1 to 1.12.2. - [Release notes](https://github.com/micrometer-metrics/micrometer/releases) - [Commits](https://github.com/micrometer-metrics/micrometer/compare/v1.12.1...v1.12.2) --- updated-dependencies: - dependency-name: io.micrometer:micrometer-bom dependency-type: direct:production update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- dubbo-dependencies-bom/pom.xml | 2 +- .../dubbo-spring-boot-starters/observability/pom.xml | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/dubbo-dependencies-bom/pom.xml b/dubbo-dependencies-bom/pom.xml index 609096cc21e..b74bb10d994 100644 --- a/dubbo-dependencies-bom/pom.xml +++ b/dubbo-dependencies-bom/pom.xml @@ -119,7 +119,7 @@ 2.2 3.14.0 0.1.35 - 1.12.1 + 1.12.2 1.2.2 3.3 diff --git a/dubbo-spring-boot/dubbo-spring-boot-starters/observability/pom.xml b/dubbo-spring-boot/dubbo-spring-boot-starters/observability/pom.xml index 191f2d42f1d..429b12eb1e2 100644 --- a/dubbo-spring-boot/dubbo-spring-boot-starters/observability/pom.xml +++ b/dubbo-spring-boot/dubbo-spring-boot-starters/observability/pom.xml @@ -36,7 +36,7 @@ - 1.12.1 + 1.12.2 1.2.2 1.34.1 2.17.2 From f20fac4e77217972d7318238f1c980d103223bc5 Mon Sep 17 00:00:00 2001 From: Saptarshi Sarkar Date: Thu, 18 Jan 2024 18:15:43 +0530 Subject: [PATCH 39/40] feat(CI): Added GitHub Actions to check for code style violations (#13489) --- .github/workflows/build-and-test-pr.yml | 61 ++++++++++++++++++++++--- 1 file changed, 55 insertions(+), 6 deletions(-) diff --git a/.github/workflows/build-and-test-pr.yml b/.github/workflows/build-and-test-pr.yml index 9ba13420b8e..921277362a0 100644 --- a/.github/workflows/build-and-test-pr.yml +++ b/.github/workflows/build-and-test-pr.yml @@ -18,7 +18,49 @@ env: ' jobs: + check-format: + name: Check if code needs formatting + runs-on: ubuntu-latest + steps: + - name: Checkout + uses: actions/checkout@v4 + - name: Setup Maven + uses: actions/setup-java@v4 + with: + java-version: 21 + distribution: zulu + - name: Check if code aligns with code style + id: check + run: mvn --log-file mvn.log spotless:check + continue-on-error: true + - name: Upload checkstyle result + uses: actions/upload-artifact@v4 + with: + name: checkstyle-result + path: mvn.log + - name: Generate Summary for successful run + if: ${{ steps.check.outcome == 'success' }} + run: | + echo ":ballot_box_with_check: Kudos! No formatting issues found!" >> $GITHUB_STEP_SUMMARY + - name: Generate Summary for failed run + if: ${{ steps.check.outcome == 'failure' }} + run: | + echo "## :negative_squared_cross_mark: Formatting issues found!" >> $GITHUB_STEP_SUMMARY + echo "\`\`\`" >> $GITHUB_STEP_SUMMARY + cat mvn.log | grep "ERROR" | sed 's/Check if code needs formatting Check if code aligns with code style [0-9A-Z:.-]\+//' | sed 's/\[ERROR] //' | head -n -11 >> $GITHUB_STEP_SUMMARY + echo "\`\`\`" >> $GITHUB_STEP_SUMMARY + echo "Please run \`mvn spotless:apply\` to fix the formatting issues." >> $GITHUB_STEP_SUMMARY + - name: Fail if code needs formatting + if: ${{ steps.check.outcome == 'failure' }} + uses: actions/github-script@v7.0.1 + with: + github-token: ${{ secrets.GITHUB_TOKEN }} + script: | + core.setFailed("Formatting issues found!") + license: + name: "Check License" + needs: check-format runs-on: ubuntu-latest steps: - uses: actions/checkout@v3 @@ -43,6 +85,8 @@ jobs: mode: check build-source: + name: "Build Dubbo" + needs: check-format runs-on: ubuntu-latest outputs: version: ${{ steps.dubbo-version.outputs.version }} @@ -98,6 +142,7 @@ jobs: unit-test-prepare: name: "Preparation for Unit Test" + needs: check-format runs-on: ubuntu-latest strategy: fail-fast: false @@ -146,7 +191,7 @@ jobs: echo "--- End Print Rsa Public Key" unit-test: - needs: [build-source, unit-test-prepare] + needs: [check-format, build-source, unit-test-prepare] name: "Unit Test On ubuntu-latest" runs-on: ubuntu-latest strategy: @@ -212,6 +257,7 @@ jobs: path: "**/target/site/**/jacoco.xml" samples-test-prepare: + needs: check-format runs-on: ubuntu-latest env: JOB_COUNT: 3 @@ -229,7 +275,7 @@ jobs: name: samples-test-list path: test/jobs samples-test-job: - needs: [build-source, samples-test-prepare] + needs: [check-format, build-source, samples-test-prepare] name: "Samples Test on ubuntu-latest (JobId: ${{matrix.job_id}})" runs-on: ubuntu-latest timeout-minutes: 90 @@ -296,7 +342,7 @@ jobs: name: samples-test-result path: test/jobs/*-result* samples-test-result: - needs: [samples-test-job] + needs: [check-format, samples-test-job] if: always() runs-on: ubuntu-latest env: @@ -315,6 +361,7 @@ jobs: run: ./test/scripts/merge-test-results.sh integration-test-prepare: + needs: check-format runs-on: ubuntu-latest env: JOB_COUNT: 3 @@ -332,7 +379,7 @@ jobs: name: test-list path: test/jobs integration-test-job: - needs: [build-source, integration-test-prepare] + needs: [check-format, build-source, integration-test-prepare] name: "Integration Test on ubuntu-latest (JobId: ${{matrix.job_id}})" runs-on: ubuntu-latest timeout-minutes: 90 @@ -399,7 +446,7 @@ jobs: name: test-result path: test/jobs/*-result* integration-test-result: - needs: [integration-test-job] + needs: [check-format, integration-test-job] if: always() runs-on: ubuntu-latest env: @@ -419,7 +466,7 @@ jobs: jacoco-result-merge: runs-on: ubuntu-latest - needs: [integration-test-result, samples-test-result, unit-test] + needs: [check-format, integration-test-result, samples-test-result, unit-test] steps: - uses: actions/checkout@v3 with: @@ -475,6 +522,7 @@ jobs: verbose: true error-code-inspecting: + needs: check-format runs-on: ubuntu-latest steps: - uses: actions/checkout@v3 @@ -513,6 +561,7 @@ jobs: path: ${{ github.workspace }}/dubbo-test-tools/dubbo-error-code-inspector/error-inspection-result.txt native-image-inspecting: + needs: check-format runs-on: ubuntu-latest steps: - uses: actions/checkout@v3 From 7a3ad4ab4151e672ffe3348d035ec44a31ee9c62 Mon Sep 17 00:00:00 2001 From: Bernardo Sauer <53480612+MajaChen@users.noreply.github.com> Date: Fri, 19 Jan 2024 11:19:35 +0800 Subject: [PATCH 40/40] Hotfix rest Chinese encoding (#13617) * decode uri in RequestFacade * supplement the unit test * fix code style violations * remove duplicate codes * consider Accept-Charset as enc * run mvn spotless apply * add comment * take weight into consideration * fix code style violations according sonar * add DEFAULT_CHARSET --------- Co-authored-by: chenxinyuan1 --- .../remoting/http/rest/RestClientTest.java | 47 +++++++++++++++++++ .../protocol/rest/constans/RestConstant.java | 3 ++ .../protocol/rest/request/RequestFacade.java | 23 +++++++++ .../protocol/rest/util/DataParseUtils.java | 37 +++++++++++++++ .../rpc/protocol/rest/DataParseUtilsTest.java | 11 +++++ .../protocol/rest/NettyRequestFacadeTest.java | 35 ++++++++++++++ 6 files changed, 156 insertions(+) diff --git a/dubbo-remoting/dubbo-remoting-http/src/test/java/org/apache/dubbo/remoting/http/rest/RestClientTest.java b/dubbo-remoting/dubbo-remoting-http/src/test/java/org/apache/dubbo/remoting/http/rest/RestClientTest.java index 3f1491e94b4..571861ae3d9 100644 --- a/dubbo-remoting/dubbo-remoting-http/src/test/java/org/apache/dubbo/remoting/http/rest/RestClientTest.java +++ b/dubbo-remoting/dubbo-remoting-http/src/test/java/org/apache/dubbo/remoting/http/rest/RestClientTest.java @@ -190,4 +190,51 @@ public void testMethod() { strings.toArray(new String[0]), requestTemplate.getParam("param").toArray(new String[0])); } + + @Test + void testBuildURL() throws Exception { + int port = NetUtils.getAvailablePort(); + URL url = new ServiceConfigURL( + "http", "localhost", port, new String[] {Constants.BIND_PORT_KEY, String.valueOf(port)}); + HttpServer httpServer = new JettyHttpServer(url, new HttpHandler() { + @Override + public void handle(HttpServletRequest request, HttpServletResponse response) throws IOException { + response.setCharacterEncoding("UTF-8"); + response.getWriter().write(request.getQueryString()); + } + }); + + RequestTemplate requestTemplate = new RequestTemplate(null, "POST", "localhost:" + port); + + requestTemplate.addParam("name", "李强"); + requestTemplate.addParam("age", "18"); + requestTemplate.path("/hello/world"); + + // When using the OKHttpRestClient, parameters will be encoded with UTF-8 and appended to the URL + RestClient restClient = new OKHttpRestClient(new HttpClientConfig()); + + CompletableFuture send = restClient.send(requestTemplate); + + RestResult restResult = send.get(); + + assertThat(new String(restResult.getBody()), is("name=%E6%9D%8E%E5%BC%BA&age=18")); + + // When using the HttpClientRestClient, parameters will be encoded with UTF-8 and appended to the URL + restClient = new HttpClientRestClient(new HttpClientConfig()); + + send = restClient.send(requestTemplate); + + restResult = send.get(); + + assertThat(new String(restResult.getBody()), is("name=%E6%9D%8E%E5%BC%BA&age=18")); + + // When using the URLConnectionRestClient, parameters won't be encoded and still appended to the URL + restClient = new URLConnectionRestClient(new HttpClientConfig()); + + send = restClient.send(requestTemplate); + + restResult = send.get(); + + assertThat(new String(restResult.getBody(), StandardCharsets.UTF_8), is("name=李强&age=18")); + } } diff --git a/dubbo-rpc/dubbo-rpc-rest/src/main/java/org/apache/dubbo/rpc/protocol/rest/constans/RestConstant.java b/dubbo-rpc/dubbo-rpc-rest/src/main/java/org/apache/dubbo/rpc/protocol/rest/constans/RestConstant.java index e50f7805258..a8d5bbc1749 100644 --- a/dubbo-rpc/dubbo-rpc-rest/src/main/java/org/apache/dubbo/rpc/protocol/rest/constans/RestConstant.java +++ b/dubbo-rpc/dubbo-rpc-rest/src/main/java/org/apache/dubbo/rpc/protocol/rest/constans/RestConstant.java @@ -43,6 +43,8 @@ public interface RestConstant { String CONNECTION = "Connection"; String CONTENT_TYPE = "Content-Type"; String TEXT_PLAIN = "text/plain"; + String ACCEPT_CHARSET = "Accept-Charset"; + String WEIGHT_IDENTIFIER = ";q="; String ACCEPT = "Accept"; String DEFAULT_ACCEPT = "*/*"; String REST_HEADER_PREFIX = "rest-service-"; @@ -54,6 +56,7 @@ public interface RestConstant { String MAX_REQUEST_SIZE_PARAM = "max.request.size"; String IDLE_TIMEOUT_PARAM = "idle.timeout"; String KEEP_ALIVE_TIMEOUT_PARAM = "keep.alive.timeout"; + String DEFAULT_CHARSET = "UTF-8"; int MAX_REQUEST_SIZE = 1024 * 1024 * 10; int MAX_INITIAL_LINE_LENGTH = 4096; diff --git a/dubbo-rpc/dubbo-rpc-rest/src/main/java/org/apache/dubbo/rpc/protocol/rest/request/RequestFacade.java b/dubbo-rpc/dubbo-rpc-rest/src/main/java/org/apache/dubbo/rpc/protocol/rest/request/RequestFacade.java index e908a552396..c3c4ac5bb8a 100644 --- a/dubbo-rpc/dubbo-rpc-rest/src/main/java/org/apache/dubbo/rpc/protocol/rest/request/RequestFacade.java +++ b/dubbo-rpc/dubbo-rpc-rest/src/main/java/org/apache/dubbo/rpc/protocol/rest/request/RequestFacade.java @@ -17,14 +17,19 @@ package org.apache.dubbo.rpc.protocol.rest.request; import org.apache.dubbo.common.utils.StringUtils; +import org.apache.dubbo.rpc.protocol.rest.constans.RestConstant; import org.apache.dubbo.rpc.protocol.rest.deploy.ServiceDeployer; +import org.apache.dubbo.rpc.protocol.rest.util.DataParseUtils; import java.io.IOException; +import java.net.URLDecoder; import java.util.ArrayList; import java.util.Enumeration; import java.util.HashMap; import java.util.Map; +import static org.apache.dubbo.rpc.protocol.rest.constans.RestConstant.DEFAULT_CHARSET; + /** * request facade for different request * @@ -55,6 +60,24 @@ protected void initHeaders() {} protected void initParameters() { String requestURI = getRequestURI(); + String decodedRequestURI = null; + + try { + String enc = DEFAULT_CHARSET; + ArrayList charset = headers.get(RestConstant.ACCEPT_CHARSET); + // take the highest priority charset + String[] parsed = DataParseUtils.parseAcceptCharset(charset); + if (parsed != null && parsed.length > 0) { + enc = parsed[0].toUpperCase(); + } + decodedRequestURI = URLDecoder.decode(requestURI, enc); + } catch (Throwable t) { + // do nothing, try best to deliver + } + + if (StringUtils.isNotEmpty(decodedRequestURI)) { + requestURI = decodedRequestURI; + } if (requestURI != null && requestURI.contains("?")) { diff --git a/dubbo-rpc/dubbo-rpc-rest/src/main/java/org/apache/dubbo/rpc/protocol/rest/util/DataParseUtils.java b/dubbo-rpc/dubbo-rpc-rest/src/main/java/org/apache/dubbo/rpc/protocol/rest/util/DataParseUtils.java index ceeae1c7450..489d99b9053 100644 --- a/dubbo-rpc/dubbo-rpc-rest/src/main/java/org/apache/dubbo/rpc/protocol/rest/util/DataParseUtils.java +++ b/dubbo-rpc/dubbo-rpc-rest/src/main/java/org/apache/dubbo/rpc/protocol/rest/util/DataParseUtils.java @@ -16,6 +16,8 @@ */ package org.apache.dubbo.rpc.protocol.rest.util; +import org.apache.dubbo.common.lang.Nullable; +import org.apache.dubbo.common.utils.CollectionUtils; import org.apache.dubbo.common.utils.JsonUtils; import org.apache.dubbo.common.utils.StringUtils; @@ -29,9 +31,16 @@ import java.nio.charset.StandardCharsets; import java.util.ArrayList; import java.util.Collection; +import java.util.Comparator; +import java.util.HashSet; import java.util.List; import java.util.Map; +import java.util.Set; +import java.util.SortedMap; import java.util.StringTokenizer; +import java.util.TreeMap; + +import static org.apache.dubbo.rpc.protocol.rest.constans.RestConstant.WEIGHT_IDENTIFIER; public class DataParseUtils { @@ -209,4 +218,32 @@ public static String[] tokenizeToStringArray( public static String[] toStringArray(Collection collection) { return collection == null ? null : collection.toArray(new String[collection.size()]); } + + @Nullable + public static String[] parseAcceptCharset(List acceptCharsets) { + if (CollectionUtils.isEmpty(acceptCharsets)) { + return new String[0]; + } + + SortedMap> encodings = new TreeMap<>(Comparator.reverseOrder()); + float defaultWeight = 1.0f; + for (String acceptCharset : acceptCharsets) { + String[] charsets = acceptCharset.split(","); + for (String charset : charsets) { + charset = charset.trim(); + float weight = defaultWeight; + String enc = charset; + if (charset.contains(WEIGHT_IDENTIFIER)) { + String[] split = charset.split(WEIGHT_IDENTIFIER); + enc = split[0]; + weight = Float.parseFloat(split[1]); + } + encodings.computeIfAbsent(weight, k -> new HashSet<>()).add(enc); + } + } + + List result = new ArrayList<>(); + encodings.values().forEach(result::addAll); + return result.toArray(new String[0]); + } } diff --git a/dubbo-rpc/dubbo-rpc-rest/src/test/java/org/apache/dubbo/rpc/protocol/rest/DataParseUtilsTest.java b/dubbo-rpc/dubbo-rpc-rest/src/test/java/org/apache/dubbo/rpc/protocol/rest/DataParseUtilsTest.java index 5b3898eb26f..896a4028151 100644 --- a/dubbo-rpc/dubbo-rpc-rest/src/test/java/org/apache/dubbo/rpc/protocol/rest/DataParseUtilsTest.java +++ b/dubbo-rpc/dubbo-rpc-rest/src/test/java/org/apache/dubbo/rpc/protocol/rest/DataParseUtilsTest.java @@ -19,6 +19,7 @@ import org.apache.dubbo.rpc.protocol.rest.util.DataParseUtils; import java.io.ByteArrayOutputStream; +import java.util.Arrays; import org.junit.jupiter.api.Assertions; import org.junit.jupiter.api.Test; @@ -56,4 +57,14 @@ void testStr() { Assertions.assertEquals(1, convert); } + + @Test + void testParseAcceptCharset() { + String[] parsed = DataParseUtils.parseAcceptCharset(Arrays.asList("iso-8859-1")); + Assertions.assertTrue(Arrays.equals(parsed, new String[] {"iso-8859-1"})); + parsed = DataParseUtils.parseAcceptCharset(Arrays.asList("utf-8, iso-8859-1;q=0.5")); + Assertions.assertTrue(Arrays.equals(parsed, new String[] {"utf-8", "iso-8859-1"})); + parsed = DataParseUtils.parseAcceptCharset(Arrays.asList("utf-8, iso-8859-1;q=0.5, *;q=0.1", "utf-16;q=0.5")); + Assertions.assertEquals("utf-8", parsed[0]); + } } diff --git a/dubbo-rpc/dubbo-rpc-rest/src/test/java/org/apache/dubbo/rpc/protocol/rest/NettyRequestFacadeTest.java b/dubbo-rpc/dubbo-rpc-rest/src/test/java/org/apache/dubbo/rpc/protocol/rest/NettyRequestFacadeTest.java index 87a30ad32cd..c923fb1d8b3 100644 --- a/dubbo-rpc/dubbo-rpc-rest/src/test/java/org/apache/dubbo/rpc/protocol/rest/NettyRequestFacadeTest.java +++ b/dubbo-rpc/dubbo-rpc-rest/src/test/java/org/apache/dubbo/rpc/protocol/rest/NettyRequestFacadeTest.java @@ -30,6 +30,9 @@ import org.junit.jupiter.api.Assertions; import org.junit.jupiter.api.Test; +import static org.hamcrest.MatcherAssert.assertThat; +import static org.hamcrest.core.Is.is; + public class NettyRequestFacadeTest { @Test @@ -95,4 +98,36 @@ void testMethod() { Assertions.assertEquals("GET", nettyRequestFacade.getMethod()); } + + @Test + void testChineseDecoding() { + String uri = "/hello/world?name=%E6%9D%8E%E5%BC%BA&age=18"; + DefaultFullHttpRequest defaultFullHttpRequest = + new DefaultFullHttpRequest(HttpVersion.HTTP_1_1, HttpMethod.GET, uri); + defaultFullHttpRequest.headers().add("Accept-Charset", "utf-8, iso-8859-1;q=0.5, *;q=0.1"); + defaultFullHttpRequest.headers().add("Accept-Charset", "utf-16;q=0.3"); + + NettyRequestFacade nettyRequestFacade = new NettyRequestFacade(defaultFullHttpRequest, null); + assertThat(nettyRequestFacade.getPath(), is("/hello/world")); + assertThat(nettyRequestFacade.getParameter("name"), is("李强")); + assertThat(nettyRequestFacade.getParameter("age"), is("18")); + + // Applying the decode method to the URI is acceptable, even if the URI is not encoded. + uri = "/hello/world?name=lily&age=18"; + defaultFullHttpRequest = new DefaultFullHttpRequest(HttpVersion.HTTP_1_1, HttpMethod.GET, uri); + + nettyRequestFacade = new NettyRequestFacade(defaultFullHttpRequest, null); + assertThat(nettyRequestFacade.getPath(), is("/hello/world")); + assertThat(nettyRequestFacade.getParameter("name"), is("lily")); + assertThat(nettyRequestFacade.getParameter("age"), is("18")); + + // When using URLConnectionRestClient, the URI won't be encoded, but it's still acceptable. + uri = "/hello/world?name=李强&age=18"; + defaultFullHttpRequest = new DefaultFullHttpRequest(HttpVersion.HTTP_1_1, HttpMethod.GET, uri); + + nettyRequestFacade = new NettyRequestFacade(defaultFullHttpRequest, null); + assertThat(nettyRequestFacade.getPath(), is("/hello/world")); + assertThat(nettyRequestFacade.getParameter("name"), is("李强")); + assertThat(nettyRequestFacade.getParameter("age"), is("18")); + } }