Denovo1998 commented on code in PR #24286:
URL: https://github.com/apache/pulsar/pull/24286#discussion_r2239909960


##########
pulsar-broker/src/main/java/org/apache/pulsar/broker/service/SystemTopicBasedTopicPoliciesService.java:
##########
@@ -218,6 +218,25 @@ private CompletableFuture<Void> 
sendTopicPolicyEvent(TopicName topicName, Action
                 });
     }
 
+    private CompletableFuture<MessageId> 
sendTopicPolicyEventInternal(TopicName topicName, ActionType actionType,
+                                      SystemTopicClient.Writer<PulsarEvent> 
writer,
+                                      @Nullable TopicPolicies policies) {
+        PulsarEvent event = getPulsarEvent(topicName, actionType, policies);
+        if (!ActionType.DELETE.equals(actionType)) {
+            return writer.writeAsync(getEventKey(event, policies != null && 
policies.isGlobalPolicies()), event);
+        }
+        // When a topic is deleting, delete both non-global and global 
topic-level policies.
+        CompletableFuture<MessageId> deletePolicies = 
writer.deleteAsync(getEventKey(event, true), event)
+            .thenCompose(__ -> {
+                return writer.deleteAsync(getEventKey(event, false), event);
+            });

Review Comment:
   @poorbarcode @lhotari It's a bit strange, why isn't 
`CompletableFuture.allOf` used here?



-- 
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-unsubscr...@pulsar.apache.org

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

Reply via email to