You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@pulsar.apache.org by GitBox <gi...@apache.org> on 2022/01/26 03:21:10 UTC
[GitHub] [pulsar] Technoboy- commented on a change in pull request #13897: Make PulsarAuthorizationProvider#grantPermissionAsync actually async
Technoboy- commented on a change in pull request #13897:
URL: https://github.com/apache/pulsar/pull/13897#discussion_r792288682
##########
File path: pulsar-broker-common/src/main/java/org/apache/pulsar/broker/authorization/PulsarAuthorizationProvider.java
##########
@@ -283,59 +282,45 @@ public void initialize(ServiceConfiguration conf, PulsarResources pulsarResource
}
String topicUri = topicName.toString();
- CompletableFuture<Void> future = pulsarResources.getNamespaceResources()
+ return pulsarResources.getNamespaceResources()
.setPoliciesAsync(topicName.getNamespaceObject(), policies -> {
policies.auth_policies.getTopicAuthentication()
.computeIfAbsent(topicUri, __ -> new HashMap<>())
.put(role, actions);
return policies;
- }).thenRun(() -> {
- log.info("[{}] Successfully granted access for role {}: {} - topic {}", role, role, actions,
- topicUri);
+ }).whenComplete((__, throwable) -> {
+ if (throwable != null) {
+ log.error("[{}] Failed to set permissions for role {} on topic {}", role, role, topicName,
+ throwable.getCause());
Review comment:
I think both are ok here, because we are only printing logs.
--
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