lhotari commented on code in PR #19412:
URL: https://github.com/apache/pulsar/pull/19412#discussion_r1095944448


##########
pulsar-broker-common/src/main/java/org/apache/pulsar/broker/authorization/PulsarAuthorizationProvider.java:
##########
@@ -140,7 +140,7 @@ public CompletableFuture<Boolean> canConsumeAsync(TopicName 
topicName, String ro
                 }).exceptionally(ex -> {
                     log.warn("Client with Role - {} failed to get permissions 
for topic - {}. {}", role, topicName,
                             ex.getMessage());
-                    return null;
+                    throw FutureUtil.wrapToCompletionException(ex);

Review Comment:
   Is the logging just extra noise if the exception gets rethrown?  Could we 
remove the `.exceptionally` completely? My assumption is that rethrowing could 
lead to the exception being logged more than 1 time.
   
   I guess `return null;` is wrong and could be `return false;` if the desire 
is to just log and continue by returning `false`.



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