315157973 commented on a change in pull request #11928:
URL: https://github.com/apache/pulsar/pull/11928#discussion_r702948239



##########
File path: 
pulsar-broker/src/main/java/org/apache/pulsar/broker/service/SystemTopicBasedTopicPoliciesService.java
##########
@@ -331,7 +343,14 @@ private void 
refreshTopicPoliciesCache(Message<PulsarEvent> msg) {
                     policiesCache.put(topicName, event.getPolicies());
                     break;
                 case DELETE:
+                    // Since PR #11928, this branch is no longer needed.
+                    // However, due to compatibility, it is temporarily 
retained here
+                    // and can be deleted in the future.
                     policiesCache.remove(topicName);
+                    SystemTopicClient<PulsarEvent> systemTopicClient = 
namespaceEventsSystemTopicFactory
+                            
.createTopicPoliciesSystemTopicClient(topicName.getNamespaceObject());
+                    systemTopicClient.newWriterAsync().thenAccept(writer
+                            -> writer.deleteAsync(getPulsarEvent(topicName, 
ActionType.DELETE, null)));

Review comment:
       I have closed the Writer.
   Now all Writers in SystemTopicBasedTopicPoliciesService seem to be created 
every time.
   I think this is reasonable, after all, Topic Policies are not high-frequency 
operations.
   




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