From 2cf54f7947596abbf92f907853a2df7cbfc8b7fb Mon Sep 17 00:00:00 2001 From: icodening Date: Fri, 19 Jan 2024 18:19:57 +0800 Subject: [PATCH 01/11] Close the connection but not the client (#13600) * Close the connection but not the client * Close the connection but not the client --- .../remoting/transport/netty4/NettyConnectionClient.java | 7 +++---- .../dubbo/rpc/protocol/tri/TriplePingPongHandler.java | 4 +++- 2 files changed, 6 insertions(+), 5 deletions(-) diff --git a/dubbo-remoting/dubbo-remoting-netty4/src/main/java/org/apache/dubbo/remoting/transport/netty4/NettyConnectionClient.java b/dubbo-remoting/dubbo-remoting-netty4/src/main/java/org/apache/dubbo/remoting/transport/netty4/NettyConnectionClient.java index 3e2fd50657..6f3171363c 100644 --- a/dubbo-remoting/dubbo-remoting-netty4/src/main/java/org/apache/dubbo/remoting/transport/netty4/NettyConnectionClient.java +++ b/dubbo-remoting/dubbo-remoting-netty4/src/main/java/org/apache/dubbo/remoting/transport/netty4/NettyConnectionClient.java @@ -131,7 +131,8 @@ public class NettyConnectionClient extends AbstractConnectionClient { NettyConfigOperator operator = new NettyConfigOperator(nettyChannel, getChannelHandler()); protocol.configClientPipeline(getUrl(), operator, nettySslContextOperator); - ch.closeFuture().addListener(channelFuture -> doClose()); + // set null but do not close this client, it will be reconnect in the future + ch.closeFuture().addListener(channelFuture -> channel.set(null)); // TODO support Socks5 } }); @@ -150,9 +151,7 @@ public class NettyConnectionClient extends AbstractConnectionClient { current.close(); } this.channel.set(null); - if (!closePromise.isDone()) { - closePromise.setSuccess(null); - } + closePromise.setSuccess(null); } } diff --git a/dubbo-rpc/dubbo-rpc-triple/src/main/java/org/apache/dubbo/rpc/protocol/tri/TriplePingPongHandler.java b/dubbo-rpc/dubbo-rpc-triple/src/main/java/org/apache/dubbo/rpc/protocol/tri/TriplePingPongHandler.java index b2134f330f..c767ee92ef 100644 --- a/dubbo-rpc/dubbo-rpc-triple/src/main/java/org/apache/dubbo/rpc/protocol/tri/TriplePingPongHandler.java +++ b/dubbo-rpc/dubbo-rpc-triple/src/main/java/org/apache/dubbo/rpc/protocol/tri/TriplePingPongHandler.java @@ -70,7 +70,9 @@ public class TriplePingPongHandler extends ChannelDuplexHandler { @Override public void run() { - ctx.close(); + if (ctx.channel().isActive()) { + ctx.close(); + } } } } From 5c0b1deb1c2fae2e37b4add093b7122da73f971e Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Fri, 26 Jan 2024 14:54:48 +0800 Subject: [PATCH 02/11] Bump netty4_version from 4.1.104.Final to 4.1.106.Final (#13682) Bumps `netty4_version` from 4.1.104.Final to 4.1.106.Final. Updates `io.netty:netty-all` from 4.1.104.Final to 4.1.106.Final - [Commits](https://github.com/netty/netty/compare/netty-4.1.104.Final...netty-4.1.106.Final) Updates `io.netty:netty-bom` from 4.1.104.Final to 4.1.106.Final - [Commits](https://github.com/netty/netty/compare/netty-4.1.104.Final...netty-4.1.106.Final) --- updated-dependencies: - dependency-name: io.netty:netty-all dependency-type: direct:development update-type: version-update:semver-patch - dependency-name: io.netty:netty-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 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/dubbo-dependencies-bom/pom.xml b/dubbo-dependencies-bom/pom.xml index b74bb10d99..83967784e8 100644 --- a/dubbo-dependencies-bom/pom.xml +++ b/dubbo-dependencies-bom/pom.xml @@ -95,7 +95,7 @@ 3.30.2-GA 1.14.11 3.2.10.Final - 4.1.104.Final + 4.1.106.Final 4.5.14 4.4.16 1.2.83 From 78bc753ff36dc20b1841781a59f2cbc9a0c47ccd Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Tue, 30 Jan 2024 17:56:43 +0800 Subject: [PATCH 03/11] Bump org.testcontainers:testcontainers from 1.19.3 to 1.19.4 (#13702) Bumps [org.testcontainers:testcontainers](https://github.com/testcontainers/testcontainers-java) from 1.19.3 to 1.19.4. - [Release notes](https://github.com/testcontainers/testcontainers-java/releases) - [Changelog](https://github.com/testcontainers/testcontainers-java/blob/main/CHANGELOG.md) - [Commits](https://github.com/testcontainers/testcontainers-java/compare/1.19.3...1.19.4) --- updated-dependencies: - dependency-name: org.testcontainers:testcontainers 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-config/dubbo-config-api/pom.xml | 2 +- dubbo-dependencies-bom/pom.xml | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/dubbo-config/dubbo-config-api/pom.xml b/dubbo-config/dubbo-config-api/pom.xml index 63ed7f1e4d..6bfb7c2f14 100644 --- a/dubbo-config/dubbo-config-api/pom.xml +++ b/dubbo-config/dubbo-config-api/pom.xml @@ -236,7 +236,7 @@ org.testcontainers testcontainers - 1.19.3 + 1.19.4 test diff --git a/dubbo-dependencies-bom/pom.xml b/dubbo-dependencies-bom/pom.xml index 83967784e8..5011e4d82d 100644 --- a/dubbo-dependencies-bom/pom.xml +++ b/dubbo-dependencies-bom/pom.xml @@ -153,7 +153,7 @@ 2.2.7 1.2.0 - 1.19.3 + 1.19.4 3.2.13 1.6.12 From e76d4478832272236be83777d57a9c3f69fc5513 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Tue, 30 Jan 2024 17:56:58 +0800 Subject: [PATCH 04/11] Bump swagger_version from 1.6.12 to 1.6.13 (#13700) Bumps `swagger_version` from 1.6.12 to 1.6.13. Updates `io.swagger:swagger-annotations` from 1.6.12 to 1.6.13 Updates `io.swagger:swagger-jaxrs` from 1.6.12 to 1.6.13 --- updated-dependencies: - dependency-name: io.swagger:swagger-annotations dependency-type: direct:production update-type: version-update:semver-patch - dependency-name: io.swagger:swagger-jaxrs 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 5011e4d82d..d73e0901b8 100644 --- a/dubbo-dependencies-bom/pom.xml +++ b/dubbo-dependencies-bom/pom.xml @@ -155,7 +155,7 @@ 1.2.0 1.19.4 3.2.13 - 1.6.12 + 1.6.13 1.1.10.5 1.70 From 399cda8ac1cae9ee68c461049c0b179a5b427738 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Tue, 30 Jan 2024 17:57:16 +0800 Subject: [PATCH 05/11] Bump org.codehaus.mojo:license-maven-plugin from 2.3.0 to 2.4.0 (#13701) Bumps [org.codehaus.mojo:license-maven-plugin](https://github.com/mojohaus/license-maven-plugin) from 2.3.0 to 2.4.0. - [Release notes](https://github.com/mojohaus/license-maven-plugin/releases) - [Commits](https://github.com/mojohaus/license-maven-plugin/compare/2.3.0...2.4.0) --- updated-dependencies: - dependency-name: org.codehaus.mojo:license-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> --- pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pom.xml b/pom.xml index caf0ac268a..aa2bed71fa 100644 --- a/pom.xml +++ b/pom.xml @@ -746,7 +746,7 @@ org.codehaus.mojo license-maven-plugin - 2.3.0 + 2.4.0 license-check From f2478b4d5cad482008cae6b8a2ad2dc2d41f3cf5 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Tue, 30 Jan 2024 17:57:22 +0800 Subject: [PATCH 06/11] Bump com.diffplug.spotless:spotless-maven-plugin from 2.42.0 to 2.43.0 (#13703) Bumps [com.diffplug.spotless:spotless-maven-plugin](https://github.com/diffplug/spotless) from 2.42.0 to 2.43.0. - [Changelog](https://github.com/diffplug/spotless/blob/main/CHANGES.md) - [Commits](https://github.com/diffplug/spotless/compare/lib/2.42.0...lib/2.43.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 990028412c..b6aaa839be 100644 --- a/dubbo-build-tools/pom.xml +++ b/dubbo-build-tools/pom.xml @@ -23,7 +23,7 @@ true - 2.42.0 + 2.43.0 check 1.0.0 2.38.0 diff --git a/dubbo-dependencies-bom/pom.xml b/dubbo-dependencies-bom/pom.xml index d73e0901b8..37f2d871f6 100644 --- a/dubbo-dependencies-bom/pom.xml +++ b/dubbo-dependencies-bom/pom.xml @@ -166,7 +166,7 @@ 2.0 1.6.0 1.25.0 - 2.42.0 + 2.43.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 5ae0066ef0..da7bbb983a 100644 --- a/dubbo-dependencies/dubbo-dependencies-zookeeper-curator5/pom.xml +++ b/dubbo-dependencies/dubbo-dependencies-zookeeper-curator5/pom.xml @@ -35,7 +35,7 @@ 1.6.0 5.1.0 3.8.3 - 2.42.0 + 2.43.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 de82fdf219..da88e22c32 100644 --- a/dubbo-dependencies/dubbo-dependencies-zookeeper/pom.xml +++ b/dubbo-dependencies/dubbo-dependencies-zookeeper/pom.xml @@ -35,7 +35,7 @@ 1.6.0 4.3.0 3.4.14 - 2.42.0 + 2.43.0 check 1.0.0 2.38.0 diff --git a/dubbo-dependencies/pom.xml b/dubbo-dependencies/pom.xml index feb18276b3..585c25fc95 100644 --- a/dubbo-dependencies/pom.xml +++ b/dubbo-dependencies/pom.xml @@ -32,7 +32,7 @@ - 2.42.0 + 2.43.0 check 1.0.0 2.38.0 diff --git a/dubbo-distribution/pom.xml b/dubbo-distribution/pom.xml index 7a6838b4fb..b038eac660 100644 --- a/dubbo-distribution/pom.xml +++ b/dubbo-distribution/pom.xml @@ -28,7 +28,7 @@ pom - 2.42.0 + 2.43.0 check 1.0.0 2.38.0 diff --git a/pom.xml b/pom.xml index aa2bed71fa..1b36f3e5c3 100644 --- a/pom.xml +++ b/pom.xml @@ -165,7 +165,7 @@ 1.2.2 3.22.3 1.54.0 - 2.42.0 + 2.43.0 check 1.0.0 2.38.0 From 29b0c7298d06fb401498b809d1a19fa6396f2cb5 Mon Sep 17 00:00:00 2001 From: namelessssssssssss <100946116+namelessssssssssss@users.noreply.github.com> Date: Wed, 31 Jan 2024 10:59:25 +0800 Subject: [PATCH 07/11] Fix port unification issue in triple and dubbo protocol (#13696) * Fix issue of tri Portunification * style fix --- .../api/pu/AbstractPortUnificationServer.java | 19 +++++++++++++------ .../netty/NettyPortUnificationServer.java | 2 +- .../netty4/NettyPortUnificationServer.java | 2 +- .../NettyPortUnificationServerHandler.java | 18 ++++++++++-------- 4 files changed, 25 insertions(+), 16 deletions(-) diff --git a/dubbo-remoting/dubbo-remoting-api/src/main/java/org/apache/dubbo/remoting/api/pu/AbstractPortUnificationServer.java b/dubbo-remoting/dubbo-remoting-api/src/main/java/org/apache/dubbo/remoting/api/pu/AbstractPortUnificationServer.java index 8704881b70..deab896553 100644 --- a/dubbo-remoting/dubbo-remoting-api/src/main/java/org/apache/dubbo/remoting/api/pu/AbstractPortUnificationServer.java +++ b/dubbo-remoting/dubbo-remoting-api/src/main/java/org/apache/dubbo/remoting/api/pu/AbstractPortUnificationServer.java @@ -17,17 +17,23 @@ package org.apache.dubbo.remoting.api.pu; import org.apache.dubbo.common.URL; +import org.apache.dubbo.common.extension.ExtensionLoader; import org.apache.dubbo.remoting.ChannelHandler; import org.apache.dubbo.remoting.RemotingException; import org.apache.dubbo.remoting.api.WireProtocol; import org.apache.dubbo.remoting.transport.AbstractServer; -import java.util.List; import java.util.Map; import java.util.concurrent.ConcurrentHashMap; +import java.util.function.Function; +import java.util.stream.Collectors; public abstract class AbstractPortUnificationServer extends AbstractServer { - private final List protocols; + + /** + * extension name -> activate WireProtocol + */ + private final Map protocols; /* protocol name --> URL object @@ -44,12 +50,13 @@ public abstract class AbstractPortUnificationServer extends AbstractServer { public AbstractPortUnificationServer(URL url, ChannelHandler handler) throws RemotingException { super(url, handler); - this.protocols = url.getOrDefaultFrameworkModel() - .getExtensionLoader(WireProtocol.class) - .getActivateExtension(url, new String[0]); + ExtensionLoader extensionLoader = + url.getOrDefaultFrameworkModel().getExtensionLoader(WireProtocol.class); + this.protocols = extensionLoader.getActivateExtension(url, new String[0]).stream() + .collect(Collectors.toConcurrentMap(extensionLoader::getExtensionName, Function.identity())); } - public List getProtocols() { + public Map getProtocols() { return protocols; } diff --git a/dubbo-remoting/dubbo-remoting-netty/src/main/java/org/apache/dubbo/remoting/transport/netty/NettyPortUnificationServer.java b/dubbo-remoting/dubbo-remoting-netty/src/main/java/org/apache/dubbo/remoting/transport/netty/NettyPortUnificationServer.java index 204009b9c1..822b9e1fb1 100644 --- a/dubbo-remoting/dubbo-remoting-netty/src/main/java/org/apache/dubbo/remoting/transport/netty/NettyPortUnificationServer.java +++ b/dubbo-remoting/dubbo-remoting-netty/src/main/java/org/apache/dubbo/remoting/transport/netty/NettyPortUnificationServer.java @@ -156,7 +156,7 @@ public class NettyPortUnificationServer extends AbstractPortUnificationServer { } catch (Throwable e) { logger.warn(TRANSPORT_FAILED_CLOSE, "", "", e.getMessage(), e); } - for (WireProtocol protocol : getProtocols()) { + for (WireProtocol protocol : getProtocols().values()) { protocol.close(); } diff --git a/dubbo-remoting/dubbo-remoting-netty4/src/main/java/org/apache/dubbo/remoting/transport/netty4/NettyPortUnificationServer.java b/dubbo-remoting/dubbo-remoting-netty4/src/main/java/org/apache/dubbo/remoting/transport/netty4/NettyPortUnificationServer.java index eaaab27f71..4af9649fc7 100644 --- a/dubbo-remoting/dubbo-remoting-netty4/src/main/java/org/apache/dubbo/remoting/transport/netty4/NettyPortUnificationServer.java +++ b/dubbo-remoting/dubbo-remoting-netty4/src/main/java/org/apache/dubbo/remoting/transport/netty4/NettyPortUnificationServer.java @@ -200,7 +200,7 @@ public class NettyPortUnificationServer extends AbstractPortUnificationServer { logger.warn(TRANSPORT_FAILED_CLOSE, "", "", e.getMessage(), e); } - for (WireProtocol protocol : getProtocols()) { + for (WireProtocol protocol : getProtocols().values()) { protocol.close(); } diff --git a/dubbo-remoting/dubbo-remoting-netty4/src/main/java/org/apache/dubbo/remoting/transport/netty4/NettyPortUnificationServerHandler.java b/dubbo-remoting/dubbo-remoting-netty4/src/main/java/org/apache/dubbo/remoting/transport/netty4/NettyPortUnificationServerHandler.java index 93ca1a824c..12ea3ffc09 100644 --- a/dubbo-remoting/dubbo-remoting-netty4/src/main/java/org/apache/dubbo/remoting/transport/netty4/NettyPortUnificationServerHandler.java +++ b/dubbo-remoting/dubbo-remoting-netty4/src/main/java/org/apache/dubbo/remoting/transport/netty4/NettyPortUnificationServerHandler.java @@ -30,6 +30,7 @@ import org.apache.dubbo.remoting.transport.netty4.ssl.SslContexts; import javax.net.ssl.SSLSession; +import java.util.HashSet; import java.util.List; import java.util.Map; import java.util.Set; @@ -51,14 +52,14 @@ public class NettyPortUnificationServerHandler extends ByteToMessageDecoder { private final URL url; private final ChannelHandler handler; private final boolean detectSsl; - private final List protocols; + private final Map protocols; private final Map urlMapper; private final Map handlerMapper; public NettyPortUnificationServerHandler( URL url, boolean detectSsl, - List protocols, + Map protocols, ChannelHandler handler, Map urlMapper, Map handlerMapper) { @@ -118,7 +119,11 @@ public class NettyPortUnificationServerHandler extends ByteToMessageDecoder { if (providerConnectionConfig != null && isSsl(in)) { enableSsl(ctx, providerConnectionConfig); } else { - for (final WireProtocol protocol : protocols) { + Set supportedProtocolNames = new HashSet<>(protocols.keySet()); + supportedProtocolNames.retainAll(urlMapper.keySet()); + + for (final String name : supportedProtocolNames) { + WireProtocol protocol = protocols.get(name); in.markReaderIndex(); ChannelBuffer buf = new NettyBackedChannelBuffer(in); final ProtocolDetector.Result result = protocol.detector().detect(buf); @@ -127,11 +132,8 @@ public class NettyPortUnificationServerHandler extends ByteToMessageDecoder { case UNRECOGNIZED: continue; case RECOGNIZED: - String protocolName = url.getOrDefaultFrameworkModel() - .getExtensionLoader(WireProtocol.class) - .getExtensionName(protocol); - ChannelHandler localHandler = this.handlerMapper.getOrDefault(protocolName, handler); - URL localURL = this.urlMapper.getOrDefault(protocolName, url); + ChannelHandler localHandler = this.handlerMapper.getOrDefault(name, handler); + URL localURL = this.urlMapper.getOrDefault(name, url); channel.setUrl(localURL); NettyConfigOperator operator = new NettyConfigOperator(channel, localHandler); protocol.configServerProtocolHandler(url, operator); From ae39a9f7f343d03c5cffccdfbe9c1cc67d67e637 Mon Sep 17 00:00:00 2001 From: huazhongming Date: Fri, 2 Feb 2024 11:25:25 +0800 Subject: [PATCH 08/11] Release 3.2.11 (#13727) Signed-off-by: crazyhzm --- 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 37f2d871f6..7432a38772 100644 --- a/dubbo-dependencies-bom/pom.xml +++ b/dubbo-dependencies-bom/pom.xml @@ -170,7 +170,7 @@ check 1.0.0 2.38.0 - 3.2.11-SNAPSHOT + 3.2.11 diff --git a/dubbo-dependencies/dubbo-dependencies-zookeeper-curator5/pom.xml b/dubbo-dependencies/dubbo-dependencies-zookeeper-curator5/pom.xml index da7bbb983a..aacb0cc1dd 100644 --- a/dubbo-dependencies/dubbo-dependencies-zookeeper-curator5/pom.xml +++ b/dubbo-dependencies/dubbo-dependencies-zookeeper-curator5/pom.xml @@ -31,7 +31,7 @@ pom - 3.2.11-SNAPSHOT + 3.2.11 1.6.0 5.1.0 3.8.3 diff --git a/dubbo-dependencies/dubbo-dependencies-zookeeper/pom.xml b/dubbo-dependencies/dubbo-dependencies-zookeeper/pom.xml index da88e22c32..18866a9366 100644 --- a/dubbo-dependencies/dubbo-dependencies-zookeeper/pom.xml +++ b/dubbo-dependencies/dubbo-dependencies-zookeeper/pom.xml @@ -31,7 +31,7 @@ pom - 3.2.11-SNAPSHOT + 3.2.11 1.6.0 4.3.0 3.4.14 diff --git a/pom.xml b/pom.xml index 1b36f3e5c3..d67110a726 100644 --- a/pom.xml +++ b/pom.xml @@ -169,7 +169,7 @@ check 1.0.0 2.38.0 - 3.2.11-SNAPSHOT + 3.2.11 From 77101ebeffbdeca5f1411bf547acdc6d1bcb8670 Mon Sep 17 00:00:00 2001 From: huazhongming Date: Fri, 2 Feb 2024 11:28:32 +0800 Subject: [PATCH 09/11] Bump version to 3.2.12-SNAPSHOT (#13726) * Bump version to 3.2.12-SNAPSHOT Signed-off-by: crazyhzm * Bump dubbo version to 3.2.11 in readme Signed-off-by: crazyhzm --------- Signed-off-by: crazyhzm --- README.md | 2 +- dubbo-dependencies-bom/pom.xml | 2 +- .../dubbo-dependencies-zookeeper-curator5/pom.xml | 2 +- dubbo-dependencies/dubbo-dependencies-zookeeper/pom.xml | 2 +- pom.xml | 2 +- 5 files changed, 5 insertions(+), 5 deletions(-) diff --git a/README.md b/README.md index c1287c0dcd..8137d2a8d4 100644 --- a/README.md +++ b/README.md @@ -42,7 +42,7 @@ There's a [README](https://github.com/apache/dubbo-samples/blob/389cd612f1ea57ee ```xml - 3.2.5 + 3.2.11 diff --git a/dubbo-dependencies-bom/pom.xml b/dubbo-dependencies-bom/pom.xml index 7432a38772..c09acad9ed 100644 --- a/dubbo-dependencies-bom/pom.xml +++ b/dubbo-dependencies-bom/pom.xml @@ -170,7 +170,7 @@ check 1.0.0 2.38.0 - 3.2.11 + 3.2.12-SNAPSHOT diff --git a/dubbo-dependencies/dubbo-dependencies-zookeeper-curator5/pom.xml b/dubbo-dependencies/dubbo-dependencies-zookeeper-curator5/pom.xml index aacb0cc1dd..5c3b0e40dd 100644 --- a/dubbo-dependencies/dubbo-dependencies-zookeeper-curator5/pom.xml +++ b/dubbo-dependencies/dubbo-dependencies-zookeeper-curator5/pom.xml @@ -31,7 +31,7 @@ pom - 3.2.11 + 3.2.12-SNAPSHOT 1.6.0 5.1.0 3.8.3 diff --git a/dubbo-dependencies/dubbo-dependencies-zookeeper/pom.xml b/dubbo-dependencies/dubbo-dependencies-zookeeper/pom.xml index 18866a9366..1c6ac5b0c1 100644 --- a/dubbo-dependencies/dubbo-dependencies-zookeeper/pom.xml +++ b/dubbo-dependencies/dubbo-dependencies-zookeeper/pom.xml @@ -31,7 +31,7 @@ pom - 3.2.11 + 3.2.12-SNAPSHOT 1.6.0 4.3.0 3.4.14 diff --git a/pom.xml b/pom.xml index d67110a726..0fcbce9ecb 100644 --- a/pom.xml +++ b/pom.xml @@ -169,7 +169,7 @@ check 1.0.0 2.38.0 - 3.2.11 + 3.2.12-SNAPSHOT From 05cecc55bccc5c4ab985f7bab3b3c63e7380ed01 Mon Sep 17 00:00:00 2001 From: Aaron <3054272+bitgorust@users.noreply.github.com> Date: Fri, 2 Feb 2024 14:10:23 +0800 Subject: [PATCH 10/11] Fixes #13684: delete outdated metrics port assertions (#13717) * fix: delete outdated metrics port assertions * chore: remove outdated port attribute in metricsType --- .../dubbo/config/AbstractInterfaceConfig.java | 19 ------------------- .../apache/dubbo/config/MetricsConfig.java | 15 --------------- .../apache/dubbo/config/ReferenceConfig.java | 1 - .../apache/dubbo/config/ServiceConfig.java | 1 - .../src/main/resources/META-INF/dubbo.xsd | 6 ------ 5 files changed, 42 deletions(-) diff --git a/dubbo-common/src/main/java/org/apache/dubbo/config/AbstractInterfaceConfig.java b/dubbo-common/src/main/java/org/apache/dubbo/config/AbstractInterfaceConfig.java index 154e33af14..9eec9c55d8 100644 --- a/dubbo-common/src/main/java/org/apache/dubbo/config/AbstractInterfaceConfig.java +++ b/dubbo-common/src/main/java/org/apache/dubbo/config/AbstractInterfaceConfig.java @@ -21,7 +21,6 @@ import org.apache.dubbo.common.Version; import org.apache.dubbo.common.config.ConfigurationUtils; import org.apache.dubbo.common.config.Environment; import org.apache.dubbo.common.config.InmemoryConfiguration; -import org.apache.dubbo.common.utils.Assert; import org.apache.dubbo.common.utils.ClassUtils; import org.apache.dubbo.common.utils.CollectionUtils; import org.apache.dubbo.common.utils.ConfigUtils; @@ -54,7 +53,6 @@ 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.TIMESTAMP_KEY; import static org.apache.dubbo.common.constants.LoggerCodeConstants.CONFIG_NO_METHOD_FOUND; -import static org.apache.dubbo.common.constants.MetricsConstants.PROTOCOL_PROMETHEUS; /** * AbstractDefaultConfig @@ -267,23 +265,6 @@ public abstract class AbstractInterfaceConfig extends AbstractMethodConfig { } } - /** - * @deprecated After metrics config is refactored. - * This method should no longer use and will be deleted in the future. - */ - @Deprecated - protected void appendMetricsCompatible(Map map) { - MetricsConfig metricsConfig = getConfigManager().getMetrics().orElse(null); - if (metricsConfig != null) { - String protocol = Optional.ofNullable(metricsConfig.getProtocol()).orElse(PROTOCOL_PROMETHEUS); - if (!StringUtils.isEquals(protocol, PROTOCOL_PROMETHEUS)) { - Assert.notEmptyString(metricsConfig.getPort(), "Metrics port cannot be null"); - map.put("metrics.protocol", protocol); - map.put("metrics.port", metricsConfig.getPort()); - } - } - } - /** * To obtain the method list in the port, use reflection when in native mode and javassist otherwise. * diff --git a/dubbo-common/src/main/java/org/apache/dubbo/config/MetricsConfig.java b/dubbo-common/src/main/java/org/apache/dubbo/config/MetricsConfig.java index dee55c87eb..15506fa3de 100644 --- a/dubbo-common/src/main/java/org/apache/dubbo/config/MetricsConfig.java +++ b/dubbo-common/src/main/java/org/apache/dubbo/config/MetricsConfig.java @@ -76,13 +76,6 @@ public class MetricsConfig extends AbstractConfig { */ private Integer collectorSyncPeriod; - /** - * @deprecated After metrics config is refactored. - * This parameter should no longer use and will be deleted in the future. - */ - @Deprecated - private String port; - /** * The prometheus metrics config */ @@ -166,14 +159,6 @@ public class MetricsConfig extends AbstractConfig { this.enableRegistry = enableRegistry; } - public String getPort() { - return port; - } - - public void setPort(String port) { - this.port = port; - } - public PrometheusConfig getPrometheus() { return prometheus; } diff --git a/dubbo-config/dubbo-config-api/src/main/java/org/apache/dubbo/config/ReferenceConfig.java b/dubbo-config/dubbo-config-api/src/main/java/org/apache/dubbo/config/ReferenceConfig.java index 4132922051..fe9f2cdacc 100644 --- a/dubbo-config/dubbo-config-api/src/main/java/org/apache/dubbo/config/ReferenceConfig.java +++ b/dubbo-config/dubbo-config-api/src/main/java/org/apache/dubbo/config/ReferenceConfig.java @@ -442,7 +442,6 @@ public class ReferenceConfig extends ReferenceConfigBase { AbstractConfig.appendParameters(map, getModule()); AbstractConfig.appendParameters(map, consumer); AbstractConfig.appendParameters(map, this); - appendMetricsCompatible(map); String hostToRegistry = ConfigUtils.getSystemProperty(DUBBO_IP_TO_REGISTRY); if (StringUtils.isEmpty(hostToRegistry)) { diff --git a/dubbo-config/dubbo-config-api/src/main/java/org/apache/dubbo/config/ServiceConfig.java b/dubbo-config/dubbo-config-api/src/main/java/org/apache/dubbo/config/ServiceConfig.java index 2d23af3d85..e77c9e2e82 100644 --- a/dubbo-config/dubbo-config-api/src/main/java/org/apache/dubbo/config/ServiceConfig.java +++ b/dubbo-config/dubbo-config-api/src/main/java/org/apache/dubbo/config/ServiceConfig.java @@ -663,7 +663,6 @@ public class ServiceConfig extends ServiceConfigBase { AbstractConfig.appendParameters(map, provider); AbstractConfig.appendParameters(map, protocolConfig); AbstractConfig.appendParameters(map, this); - appendMetricsCompatible(map); // append params with method configs, if (CollectionUtils.isNotEmpty(getMethods())) { diff --git a/dubbo-config/dubbo-config-spring/src/main/resources/META-INF/dubbo.xsd b/dubbo-config/dubbo-config-spring/src/main/resources/META-INF/dubbo.xsd index 411f55a3c4..97625834ad 100644 --- a/dubbo-config/dubbo-config-spring/src/main/resources/META-INF/dubbo.xsd +++ b/dubbo-config/dubbo-config-spring/src/main/resources/META-INF/dubbo.xsd @@ -1103,12 +1103,6 @@ - - - - - - From b7cd1f933f0df9e2d94734760200938e9097e72f Mon Sep 17 00:00:00 2001 From: Albumen Kevin Date: Sun, 4 Feb 2024 09:59:20 +0800 Subject: [PATCH 11/11] Fix NPE in DefaultTypeBuilder (#13732) * Fix NPE in DefaultTypeBuilder * Fix style --- .../builder/DefaultTypeBuilder.java | 11 +++-- .../definition/DefaultTypeBuilderTest.java | 44 +++++++++++++++++++ 2 files changed, 51 insertions(+), 4 deletions(-) create mode 100644 dubbo-common/src/test/java/org/apache/dubbo/metadata/definition/DefaultTypeBuilderTest.java diff --git a/dubbo-common/src/main/java/org/apache/dubbo/metadata/definition/builder/DefaultTypeBuilder.java b/dubbo-common/src/main/java/org/apache/dubbo/metadata/definition/builder/DefaultTypeBuilder.java index 2da24303cb..adf70e16cf 100755 --- a/dubbo-common/src/main/java/org/apache/dubbo/metadata/definition/builder/DefaultTypeBuilder.java +++ b/dubbo-common/src/main/java/org/apache/dubbo/metadata/definition/builder/DefaultTypeBuilder.java @@ -32,15 +32,18 @@ import java.util.Map; public final class DefaultTypeBuilder { public static TypeDefinition build(Class clazz, Map typeCache) { - final String canonicalName = clazz.getCanonicalName(); + String className = clazz.getCanonicalName(); + if (className == null) { + className = clazz.getName(); + } // Try to get a cached definition - TypeDefinition td = typeCache.get(canonicalName); + TypeDefinition td = typeCache.get(className); if (td != null) { return td; } - td = new TypeDefinition(canonicalName); - typeCache.put(canonicalName, td); + td = new TypeDefinition(className); + typeCache.put(className, td); // Primitive type if (!JaketConfigurationUtils.needAnalyzing(clazz)) { diff --git a/dubbo-common/src/test/java/org/apache/dubbo/metadata/definition/DefaultTypeBuilderTest.java b/dubbo-common/src/test/java/org/apache/dubbo/metadata/definition/DefaultTypeBuilderTest.java new file mode 100644 index 0000000000..74a691227c --- /dev/null +++ b/dubbo-common/src/test/java/org/apache/dubbo/metadata/definition/DefaultTypeBuilderTest.java @@ -0,0 +1,44 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. + * The ASF licenses this file to You under the Apache License, Version 2.0 + * (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.apache.dubbo.metadata.definition; + +import org.apache.dubbo.metadata.definition.builder.DefaultTypeBuilder; +import org.apache.dubbo.rpc.model.FrameworkModel; + +import java.util.HashMap; + +import org.junit.jupiter.api.Assertions; +import org.junit.jupiter.api.Test; + +public class DefaultTypeBuilderTest { + @Test + void testInnerClass() { + TypeDefinitionBuilder.initBuilders(FrameworkModel.defaultModel()); + + Assertions.assertEquals( + String.class.getName(), + DefaultTypeBuilder.build(String.class, new HashMap<>()).getType()); + + DefaultTypeBuilderTest innerObject = new DefaultTypeBuilderTest() {}; + Assertions.assertEquals( + DefaultTypeBuilderTest.class.getName() + "$1", + DefaultTypeBuilder.build(innerObject.getClass(), new HashMap<>()) + .getType()); + + TypeDefinitionBuilder.BUILDERS = null; + } +}