pinxiong commented on a change in pull request #8508:
URL: https://github.com/apache/dubbo/pull/8508#discussion_r690959365



##########
File path: 
dubbo-registry/dubbo-registry-multiple/src/main/java/org/apache/dubbo/registry/multiple/MultipleRegistry.java
##########
@@ -200,9 +195,27 @@ public void unsubscribe(URL url, NotifyListener listener) {
                 urls.addAll(tmpUrls);
             }
         }
+        urls = removeDuplicate(urls);
         return urls;
     }
 
+    protected static List<URL> removeDuplicate(List<URL> urls) {
+        Set<List<String>> set = new HashSet<>();
+        List<URL> dedupList = new ArrayList<>();
+        for (URL url : urls) {
+            List<String> tmp = new ArrayList<>();
+            tmp.add(url.getAddress());
+            tmp.add(url.getProtocol());
+            tmp.add(url.getParameter("group"));
+            tmp.add(url.getParameter("version"));
+            if (!set.contains(tmp)) {
+                set.add(tmp);
+                dedupList.add(url);
+            }

Review comment:
       This is a multi-instance problem, and the community is discussing a 
reasonable solution to solve this issue. There are some thing duscussed in 
community, such as
   
   + How to define an unique instance
   + What resources need to be shared in a multi-instance scenario
   + How to define the lifecycle of the instance
   
   If you are interested in this problem, welcome to join the metting!
   
   + Metting tool: [DingDing](https://www.dingtalk.com/)
   + Meeting Code: `864 912 87261`
   + Reference: [Agenda](https://www.yuque.com/apache-dubbo/dubbo3/wz70lz)




-- 
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]

Reply via email to