You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@dubbo.apache.org by al...@apache.org on 2021/04/11 12:29:03 UTC

[dubbo] branch master updated: [dubbo-4097] fix registry of etcd set 'group' cannot isolate (#4825)

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

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


The following commit(s) were added to refs/heads/master by this push:
     new 6504db6   [dubbo-4097] fix registry of etcd set 'group' cannot isolate (#4825)
6504db6 is described below

commit 6504db62d43468e4636e78214d0ad2c9250f46bd
Author: windWheel <18...@qq.com>
AuthorDate: Sun Apr 11 20:28:50 2021 +0800

     [dubbo-4097] fix registry of etcd set 'group' cannot isolate (#4825)
    
    Co-authored-by: Xin Wang <xi...@gmail.com>
---
 .../java/org/apache/dubbo/registry/etcd/EtcdRegistry.java     | 11 ++++++++---
 1 file changed, 8 insertions(+), 3 deletions(-)

diff --git a/dubbo-registry/dubbo-registry-etcd3/src/main/java/org/apache/dubbo/registry/etcd/EtcdRegistry.java b/dubbo-registry/dubbo-registry-etcd3/src/main/java/org/apache/dubbo/registry/etcd/EtcdRegistry.java
index 8d054b6..def1c7d 100644
--- a/dubbo-registry/dubbo-registry-etcd3/src/main/java/org/apache/dubbo/registry/etcd/EtcdRegistry.java
+++ b/dubbo-registry/dubbo-registry-etcd3/src/main/java/org/apache/dubbo/registry/etcd/EtcdRegistry.java
@@ -247,9 +247,14 @@ public class EtcdRegistry extends FailbackRegistry {
         if (listeners != null) {
             ChildListener etcdListener = listeners.get(listener);
             if (etcdListener != null) {
-                // maybe url has many subscribed paths
-                for (String path : toUnsubscribedPath(url)) {
-                    etcdClient.removeChildListener(path, etcdListener);
+                if (ANY_VALUE.equals(url.getServiceInterface())) {
+                    String root = toRootPath();
+                    etcdClient.removeChildListener(root, etcdListener);
+                }else {
+                    // maybe url has many subscribed paths
+                    for (String path : toUnsubscribedPath(url)) {
+                        etcdClient.removeChildListener(path, etcdListener);
+                    }
                 }
             }
         }