- [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
---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscr...@dubbo.apache.org
For additional commands, e-mail: notifications-h...@dubbo.apache.org

Reply via email to