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: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]