From 33e4f11c9f9722bea40048414ca3f0cb6a5be652 Mon Sep 17 00:00:00 2001 From: fengyubiao Date: Wed, 14 Sep 2022 23:56:10 +0800 Subject: [PATCH] Cover more logical branches: topic future has exceptionally complete --- .../java/org/apache/pulsar/broker/service/BrokerService.java | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/pulsar-broker/src/main/java/org/apache/pulsar/broker/service/BrokerService.java b/pulsar-broker/src/main/java/org/apache/pulsar/broker/service/BrokerService.java index 332e149957bac9..331641232f9254 100644 --- a/pulsar-broker/src/main/java/org/apache/pulsar/broker/service/BrokerService.java +++ b/pulsar-broker/src/main/java/org/apache/pulsar/broker/service/BrokerService.java @@ -2029,7 +2029,9 @@ public CompletableFuture removeTopicFromCache(String topicNameString, Topi // Do remove. return removeTopicFutureFromCache(topicNameString, createTopicFuture); } - }); + // If the future in cache has exception complete, + // the topic instance in the cache is not the same with the topic. + }).exceptionally(ex -> null); } private CompletableFuture removeTopicFutureFromCache(String topic,