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

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


The following commit(s) were added to refs/heads/3.2 by this push:
     new a534350541 fix: Support disable Curator EnsembleTracker in 
ServiceDiscovery (#14285)
a534350541 is described below

commit a534350541c94709b6f529c2b3a0f1cd6d44c3dc
Author: aofall <[email protected]>
AuthorDate: Wed Jun 5 11:39:27 2024 +0800

    fix: Support disable Curator EnsembleTracker in ServiceDiscovery (#14285)
---
 .../apache/dubbo/registry/zookeeper/util/CuratorFrameworkUtils.java    | 3 +++
 1 file changed, 3 insertions(+)

diff --git 
a/dubbo-registry/dubbo-registry-zookeeper/src/main/java/org/apache/dubbo/registry/zookeeper/util/CuratorFrameworkUtils.java
 
b/dubbo-registry/dubbo-registry-zookeeper/src/main/java/org/apache/dubbo/registry/zookeeper/util/CuratorFrameworkUtils.java
index 83b47fc1c1..b5cf4a4118 100644
--- 
a/dubbo-registry/dubbo-registry-zookeeper/src/main/java/org/apache/dubbo/registry/zookeeper/util/CuratorFrameworkUtils.java
+++ 
b/dubbo-registry/dubbo-registry-zookeeper/src/main/java/org/apache/dubbo/registry/zookeeper/util/CuratorFrameworkUtils.java
@@ -43,6 +43,7 @@ import org.apache.zookeeper.data.ACL;
 
 import static org.apache.curator.x.discovery.ServiceInstance.builder;
 import static org.apache.dubbo.common.constants.CommonConstants.PATH_SEPARATOR;
+import static 
org.apache.dubbo.common.constants.CommonConstants.ZOOKEEPER_ENSEMBLE_TRACKER_KEY;
 import static 
org.apache.dubbo.registry.zookeeper.ZookeeperServiceDiscovery.DEFAULT_GROUP;
 import static 
org.apache.dubbo.registry.zookeeper.util.CuratorFrameworkParams.BASE_SLEEP_TIME;
 import static 
org.apache.dubbo.registry.zookeeper.util.CuratorFrameworkParams.BLOCK_UNTIL_CONNECTED_UNIT;
@@ -69,8 +70,10 @@ public abstract class CuratorFrameworkUtils {
 
     public static CuratorFramework buildCuratorFramework(URL connectionURL, 
ZookeeperServiceDiscovery serviceDiscovery)
             throws Exception {
+        boolean ensembleTracker = 
connectionURL.getParameter(ZOOKEEPER_ENSEMBLE_TRACKER_KEY, true);
         CuratorFrameworkFactory.Builder builder = 
CuratorFrameworkFactory.builder()
                 .connectString(connectionURL.getBackupAddress())
+                .ensembleTracker(ensembleTracker)
                 .retryPolicy(buildRetryPolicy(connectionURL));
         String userInformation = connectionURL.getUserInformation();
         if (StringUtils.isNotEmpty(userInformation)) {

Reply via email to