poorbarcode commented on code in PR #20561:
URL: https://github.com/apache/pulsar/pull/20561#discussion_r1226619706
##########
pulsar-broker/src/main/java/org/apache/pulsar/broker/service/BrokerService.java:
##########
@@ -1091,6 +1091,9 @@ public CompletableFuture<Optional<Topic>> getTopic(final
TopicName topicName, bo
}
});
}
+ final CompletableFuture<Optional<Topic>> topicFutureToRemove =
topicFuture;
+ topicFuture.whenComplete((ignore, ex) ->
topics.remove(topicName.toString(), topicFutureToRemove));
Review Comment:
@eolivelli
Ah, sorry. I lost a check: `if (ex != null)`. It only is removed if the
future was failed, and we call `remove(k, v)`, and this method will not do
incorrect deletions. Could you take a look again?
--
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]