githublaohu commented on code in PR #1264:
URL: 
https://github.com/apache/incubator-eventmesh/pull/1264#discussion_r973507433


##########
eventmesh-connector-plugin/eventmesh-connector-kafka/src/main/java/org/apache/eventmesh/connector/kafka/consumer/ConsumerImpl.java:
##########
@@ -108,9 +109,9 @@ public void subscribe(String topic) {
 
     public void unsubscribe(String topic) {
         try {
-            // Get the current subscription
+            // Kafka will unsubscribe *all* topic if calling unsubscribe, so we
             this.kafkaConsumer.unsubscribe();
-            topicsSet.add(topic);
+            topicsSet.remove(topic);

Review Comment:
   HashSet不是线程安全的,请保证topics.remove(),与115是线程安全的



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