This is an automated email from the ASF dual-hosted git repository.

rong pushed a commit to branch dev/1.3
in repository https://gitbox.apache.org/repos/asf/iotdb.git


The following commit(s) were added to refs/heads/dev/1.3 by this push:
     new c77c9bbcb0c Subscription: return immediately when unsubscribe empty 
complete topics (#15770) (#15781)
c77c9bbcb0c is described below

commit c77c9bbcb0c17d6d7c8ae5ac80c03b5f71461040
Author: VGalaxies <[email protected]>
AuthorDate: Thu Jun 19 10:47:26 2025 +0800

    Subscription: return immediately when unsubscribe empty complete topics 
(#15770) (#15781)
---
 .../iotdb/db/subscription/receiver/SubscriptionReceiverV1.java      | 6 ++++++
 1 file changed, 6 insertions(+)

diff --git 
a/iotdb-core/datanode/src/main/java/org/apache/iotdb/db/subscription/receiver/SubscriptionReceiverV1.java
 
b/iotdb-core/datanode/src/main/java/org/apache/iotdb/db/subscription/receiver/SubscriptionReceiverV1.java
index 17c08543ed6..c1e52165b8d 100644
--- 
a/iotdb-core/datanode/src/main/java/org/apache/iotdb/db/subscription/receiver/SubscriptionReceiverV1.java
+++ 
b/iotdb-core/datanode/src/main/java/org/apache/iotdb/db/subscription/receiver/SubscriptionReceiverV1.java
@@ -703,6 +703,12 @@ public class SubscriptionReceiverV1 implements 
SubscriptionReceiver {
     final List<String> topicNamesToUnsubscribe =
         
SubscriptionAgent.broker().fetchTopicNamesToUnsubscribe(consumerConfig, 
topics.keySet());
 
+    // If it is empty, it could be that the consumer has been closed, or there 
are no completed
+    // topics. In this case, it should immediately return.
+    if (topicNamesToUnsubscribe.isEmpty()) {
+      return;
+    }
+
     unsubscribe(consumerConfig, new HashSet<>(topicNamesToUnsubscribe));
     LOGGER.info(
         "Subscription: consumer {} unsubscribe {} (completed topics) 
successfully",

Reply via email to