You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@dubbo.apache.org by "CodingSinger (GitHub)" <gi...@apache.org> on 2019/09/19 04:19:47 UTC

[GitHub] [dubbo] CodingSinger opened issue #5085: 修复ZookeeperRegistry在监听所有接口的情况下,接口目录丢失导致的bug

- [x] I have searched the [issues](https://github.com/apache/dubbo/issues) of this repository and believe that this is not a duplicate.
- [x] I have checked the [FAQ](https://github.com/apache/dubbo/blob/master/FAQ.md) of this repository and believe that this is not a duplicate.

### Environment

* Dubbo version: 2.7.4-SNAPSHOT
* Operating System version: macOS10.12.6
* Java version: 1.8

### Steps to reproduce this issue
主要是配合dubbo admin的时候,如果意外删除了接口目录,导致之后该接口的实例将不再被发现
1. 启动dubbo-admin
2. 启动dubbo生产者,此时dubbo-admin有该生产者记录
3. 关闭生产者,并且删除该生产者的接口目录
4. 重启生产者,将不会在dubbo-admin上看到相关记录


主要原因是以下回调对anyServices只有add操作,没有delete操作,导致下一次目录变化时,也不会进入if中进行订阅新增接口。
```java
 listeners.putIfAbsent(listener, (parentPath, currentChilds) -> {
                        for (String child : currentChilds) {
                            child = URL.decode(child);
                            if (!anyServices.contains(child)) {
                                anyServices.add(child);
                                subscribe(url.setPath(child).addParameters(INTERFACE_KEY, child,
                                        Constants.CHECK_KEY, String.valueOf(false)), listener);
                            } 
                    });

```

[ Full content available at: https://github.com/apache/dubbo/issues/5085 ]
This message was relayed via gitbox.apache.org for notifications@dubbo.apache.org

[GitHub] [dubbo] Patrick0308 commented on issue #5085: 修复ZookeeperRegistry在监听所有接口的情况下,接口目录丢失导致的bug

Posted by "Patrick0308 (GitHub)" <gi...@apache.org>.
这么做的话,zookeeper上短时间内删除和增加相同的节点会导致所有机器重新subcribe这些节点,会不会波动有点大?

[ Full content available at: https://github.com/apache/dubbo/issues/5085 ]
This message was relayed via gitbox.apache.org for notifications@dubbo.apache.org