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 2018/05/17 03:51:20 UTC

[incubator-dubbo] branch master updated: Merge pull request #1792, fix zk unsubscribe issue.

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

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


The following commit(s) were added to refs/heads/master by this push:
     new 2d7e182  Merge pull request #1792, fix zk unsubscribe issue.
2d7e182 is described below

commit 2d7e18242f74ff66be81b3c35e68e5b5fb5fe95f
Author: nzomkxia <z8...@gmail.com>
AuthorDate: Thu May 17 11:51:17 2018 +0800

    Merge pull request #1792, fix zk unsubscribe issue.
---
 .../com/alibaba/dubbo/registry/zookeeper/ZookeeperRegistry.java  | 9 ++++++++-
 1 file changed, 8 insertions(+), 1 deletion(-)

diff --git a/dubbo-registry/dubbo-registry-zookeeper/src/main/java/com/alibaba/dubbo/registry/zookeeper/ZookeeperRegistry.java b/dubbo-registry/dubbo-registry-zookeeper/src/main/java/com/alibaba/dubbo/registry/zookeeper/ZookeeperRegistry.java
index 8bebf53..6835c2c 100644
--- a/dubbo-registry/dubbo-registry-zookeeper/src/main/java/com/alibaba/dubbo/registry/zookeeper/ZookeeperRegistry.java
+++ b/dubbo-registry/dubbo-registry-zookeeper/src/main/java/com/alibaba/dubbo/registry/zookeeper/ZookeeperRegistry.java
@@ -200,7 +200,14 @@ public class ZookeeperRegistry extends FailbackRegistry {
         if (listeners != null) {
             ChildListener zkListener = listeners.get(listener);
             if (zkListener != null) {
-                zkClient.removeChildListener(toUrlPath(url), zkListener);
+                if (Constants.ANY_VALUE.equals(url.getServiceInterface())) {
+                    String root = toRootPath();
+                    zkClient.removeChildListener(root, zkListener);
+                } else {
+                    for (String path : toCategoriesPath(url)) {
+                        zkClient.removeChildListener(path, zkListener);
+                    }
+                }
             }
         }
     }

-- 
To stop receiving notification emails like this one, please contact
liujun@apache.org.