xwm1992 commented on a change in pull request #388:
URL: 
https://github.com/apache/incubator-eventmesh/pull/388#discussion_r652424697



##########
File path: 
eventmesh-sdk-java/src/main/java/org/apache/eventmesh/client/http/consumer/LiteConsumer.java
##########
@@ -234,7 +237,13 @@ public void run() {
     }
 
     public boolean unsubscribe(List<String> topicList, String url) throws 
Exception {
-        subscription.removeAll(topicList);
+        Set<String> unSub = new HashSet<>(topicList);
+        for (SubscriptionItem item:subscription) {
+            if (unSub.contains(item.getTopic())) {
+                subscription.remove(item);

Review comment:
       Here, may cause ConcurrentModification Exception, use iterator may be 
better, please take a look




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

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