dragosvictor commented on code in PR #22379:
URL: https://github.com/apache/pulsar/pull/22379#discussion_r1543614920


##########
pulsar-broker/src/main/java/org/apache/pulsar/broker/service/BrokerService.java:
##########
@@ -2244,9 +2244,18 @@ private CompletableFuture<Integer> 
unloadServiceUnit(NamespaceBundle serviceUnit
                 closeFutures.add(topicFuture
                         .thenCompose(t -> t.isPresent() ? t.get().close(
                                 disconnectClients, 
closeWithoutWaitingClientDisconnect)
-                                : CompletableFuture.completedFuture(null)));
+                                : CompletableFuture.completedFuture(null))
+                        .exceptionally(e -> {
+                            if (e.getCause() instanceof 
BrokerServiceException.ServiceUnitNotReadyException
+                                    && e.getMessage().contains("Please redo 
the lookup")) {
+                                log.warn("[{}] Topic ownership check failed. 
Skipping it", topicName);
+                                return null;

Review Comment:
   Since we're adding a null element to `closeFutures`, would this cause an 
exception further down in `FutureUtil.waitForAll`? The 
[documentation](https://docs.oracle.com/en%2Fjava%2Fjavase%2F11%2Fdocs%2Fapi%2F%2F/java.base/java/util/concurrent/CompletableFuture.html#allOf(java.util.concurrent.CompletableFuture...))
 suggests so.



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

Reply via email to