You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@dubbo.apache.org by li...@apache.org on 2021/02/22 08:18:38 UTC

[dubbo] branch 3.0 updated: fix AbstractRegistryFactory bug (#7005)

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

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


The following commit(s) were added to refs/heads/3.0 by this push:
     new aeed39e  fix AbstractRegistryFactory bug (#7005)
aeed39e is described below

commit aeed39e71f1d7f2d3dec13ee425d261c91d930c3
Author: 张志勇 <go...@163.com>
AuthorDate: Mon Feb 22 16:18:22 2021 +0800

    fix AbstractRegistryFactory bug (#7005)
---
 .../src/main/java/org/apache/dubbo/rpc/cluster/Constants.java          | 2 ++
 .../org/apache/dubbo/registry/support/AbstractRegistryFactory.java     | 3 ++-
 2 files changed, 4 insertions(+), 1 deletion(-)

diff --git a/dubbo-cluster/src/main/java/org/apache/dubbo/rpc/cluster/Constants.java b/dubbo-cluster/src/main/java/org/apache/dubbo/rpc/cluster/Constants.java
index 4bd1595..1929ea3 100644
--- a/dubbo-cluster/src/main/java/org/apache/dubbo/rpc/cluster/Constants.java
+++ b/dubbo-cluster/src/main/java/org/apache/dubbo/rpc/cluster/Constants.java
@@ -95,6 +95,8 @@ public interface Constants {
      * The key name for reference URL in register center
      */
     String REFER_KEY = "refer";
+
+    String TIMESTAMP_KEY = "timestamp";
     /**
      * The key name for export URL in register center
      */
diff --git a/dubbo-registry/dubbo-registry-api/src/main/java/org/apache/dubbo/registry/support/AbstractRegistryFactory.java b/dubbo-registry/dubbo-registry-api/src/main/java/org/apache/dubbo/registry/support/AbstractRegistryFactory.java
index 541c22a..ba6e0c9 100644
--- a/dubbo-registry/dubbo-registry-api/src/main/java/org/apache/dubbo/registry/support/AbstractRegistryFactory.java
+++ b/dubbo-registry/dubbo-registry-api/src/main/java/org/apache/dubbo/registry/support/AbstractRegistryFactory.java
@@ -40,6 +40,7 @@ import java.util.stream.Collectors;
 import static org.apache.dubbo.common.constants.CommonConstants.INTERFACE_KEY;
 import static org.apache.dubbo.rpc.cluster.Constants.EXPORT_KEY;
 import static org.apache.dubbo.rpc.cluster.Constants.REFER_KEY;
+import static org.apache.dubbo.rpc.cluster.Constants.TIMESTAMP_KEY;
 
 /**
  * AbstractRegistryFactory. (SPI, Singleton, ThreadSafe)
@@ -120,7 +121,7 @@ public abstract class AbstractRegistryFactory implements RegistryFactory {
         url = URLBuilder.from(url)
                 .setPath(RegistryService.class.getName())
                 .addParameter(INTERFACE_KEY, RegistryService.class.getName())
-                .removeParameters(EXPORT_KEY, REFER_KEY)
+                .removeParameters(EXPORT_KEY, REFER_KEY, TIMESTAMP_KEY)
                 .build();
         String key = createRegistryCacheKey(url);
         // Lock the registry access process to ensure a single instance of the registry