You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@dubbo.apache.org by cr...@apache.org on 2022/06/06 11:44:43 UTC

[dubbo] branch master updated: fix #10059, fix ZookeeperDynamicConfiguration remove cache listener mistake (#10106)

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

crazyhzm 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 edd3d282eb fix #10059, fix ZookeeperDynamicConfiguration remove cache listener mistake (#10106)
edd3d282eb is described below

commit edd3d282ebdb56222d6951ebcff6deb77478957f
Author: Wang Chengming <63...@qq.com>
AuthorDate: Mon Jun 6 19:43:59 2022 +0800

    fix #10059, fix ZookeeperDynamicConfiguration remove cache listener mistake (#10106)
    
    Co-authored-by: 呈铭 <be...@antgroup.com>
---
 .../configcenter/support/zookeeper/ZookeeperDynamicConfiguration.java | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/dubbo-configcenter/dubbo-configcenter-zookeeper/src/main/java/org/apache/dubbo/configcenter/support/zookeeper/ZookeeperDynamicConfiguration.java b/dubbo-configcenter/dubbo-configcenter-zookeeper/src/main/java/org/apache/dubbo/configcenter/support/zookeeper/ZookeeperDynamicConfiguration.java
index d445bd3c21..303f823748 100644
--- a/dubbo-configcenter/dubbo-configcenter-zookeeper/src/main/java/org/apache/dubbo/configcenter/support/zookeeper/ZookeeperDynamicConfiguration.java
+++ b/dubbo-configcenter/dubbo-configcenter-zookeeper/src/main/java/org/apache/dubbo/configcenter/support/zookeeper/ZookeeperDynamicConfiguration.java
@@ -121,10 +121,10 @@ public class ZookeeperDynamicConfiguration extends TreePathDynamicConfiguration
 
     @Override
     protected void doRemoveListener(String pathKey, ConfigurationListener listener) {
+        cacheListener.removeListener(pathKey, listener);
         Set<ConfigurationListener> configurationListeners = cacheListener.getConfigurationListeners(pathKey);
-        if (CollectionUtils.isNotEmpty(configurationListeners)) {
+        if (CollectionUtils.isEmpty(configurationListeners)) {
             zkClient.removeDataListener(pathKey, cacheListener);
         }
-        cacheListener.removeListener(pathKey, listener);
     }
 }