You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@pulsar.apache.org by "lhotari (via GitHub)" <gi...@apache.org> on 2023/02/03 15:41:44 UTC

[GitHub] [pulsar] lhotari commented on a diff in pull request #19412: [fix][authorization] Fix the return value of canConsumeAsync

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?
   
   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: commits-unsubscribe@pulsar.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org