Skip to content

Commit ba447eb

Browse files
nzomkxiachickenlj
authored andcommitted
Merge pull request apache#1792, fix zk unsubscribe issue.
1 parent b0b1453 commit ba447eb

File tree

1 file changed

+8
-1
lines changed
  • dubbo-registry/dubbo-registry-zookeeper/src/main/java/com/alibaba/dubbo/registry/zookeeper

1 file changed

+8
-1
lines changed

dubbo-registry/dubbo-registry-zookeeper/src/main/java/com/alibaba/dubbo/registry/zookeeper/ZookeeperRegistry.java

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -200,7 +200,14 @@ protected void doUnsubscribe(URL url, NotifyListener listener) {
200200
if (listeners != null) {
201201
ChildListener zkListener = listeners.get(listener);
202202
if (zkListener != null) {
203-
zkClient.removeChildListener(toUrlPath(url), zkListener);
203+
if (Constants.ANY_VALUE.equals(url.getServiceInterface())) {
204+
String root = toRootPath();
205+
zkClient.removeChildListener(root, zkListener);
206+
} else {
207+
for (String path : toCategoriesPath(url)) {
208+
zkClient.removeChildListener(path, zkListener);
209+
}
210+
}
204211
}
205212
}
206213
}

0 commit comments

Comments
 (0)