SZFHH opened a new issue, #10059: URL: https://github.com/apache/dubbo/issues/10059
<!-- If you need to report a security issue please visit https://github.com/apache/dubbo/security/policy --> - [x] I have searched the [issues](https://github.com/apache/dubbo/issues) of this repository and believe that this is not a duplicate. ## Ask your question here ```java // ZookeeperDynamicConfiguration @Override protected void doRemoveListener(String pathKey, ConfigurationListener listener) { Set<ConfigurationListener> configurationListeners = cacheListener.getConfigurationListeners(pathKey); // 为什么要把整个cacheListener都删掉? if (CollectionUtils.isNotEmpty(configurationListeners)) { zkClient.removeDataListener(pathKey, cacheListener); } cacheListener.removeListener(pathKey, listener); } ``` 为什么删除pathKey中的一个ConfigurationListener要把整个cacheListener都删掉?这样不是相当于这个pathKey下所有的ConfigurationListener都失效了吗? 不知道是不是下面这个逻辑比较合理 ```java @Override protected void doRemoveListener(String pathKey, ConfigurationListener listener) { cacheListener.removeListener(pathKey, listener); Set<ConfigurationListener> configurationListeners = cacheListener.getConfigurationListeners(pathKey); if (CollectionUtils.isEmpty(configurationListeners)) { zkClient.removeDataListener(pathKey, cacheListener); } } ``` -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: [email protected] For queries about this service, please contact Infrastructure at: [email protected] --------------------------------------------------------------------- To unsubscribe, e-mail: [email protected] For additional commands, e-mail: [email protected]
