This is an automated email from the ASF dual-hosted git repository.
rong pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/iotdb.git
The following commit(s) were added to refs/heads/master by this push:
new c603b990c75 Subscription: return immediately when unsubscribe empty
complete topics (#15770)
c603b990c75 is described below
commit c603b990c75b5342402d1f1ca3cf696997a1c132
Author: VGalaxies <[email protected]>
AuthorDate: Wed Jun 18 18:39:55 2025 +0800
Subscription: return immediately when unsubscribe empty complete topics
(#15770)
---
.../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 f135dadd6a1..fe9a7505e3a 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
@@ -705,6 +705,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",