zhanghaou commented on code in PR #20613:
URL: https://github.com/apache/pulsar/pull/20613#discussion_r1241049899


##########
pulsar-broker/src/main/java/org/apache/pulsar/broker/service/SystemTopicBasedTopicPoliciesService.java:
##########
@@ -362,13 +362,20 @@ private void 
initPolicesCache(SystemTopicClient.Reader<PulsarEvent> reader, Comp
                 policyCacheInitMap.computeIfPresent(
                         
reader.getSystemTopic().getTopicName().getNamespaceObject(), (k, v) -> true);
                 // replay policy message
-                policiesCache.forEach(((topicName, topicPolicies) -> {
-                    if (listeners.get(topicName) != null) {
-                        for (TopicPolicyListener<TopicPolicies> listener : 
listeners.get(topicName)) {
-                            listener.onUpdate(topicPolicies);
+                try {
+                    policiesCache.forEach(((topicName, topicPolicies) -> {
+                        if (listeners.get(topicName) != null) {
+                            for (TopicPolicyListener<TopicPolicies> listener : 
listeners.get(topicName)) {
+                                listener.onUpdate(topicPolicies);

Review Comment:
   If we complete directly, it may introduce data inconsistency? Complete 
directly or throws exception depends on the importance of this method. From the 
source pr(https://github.com/apache/pulsar/pull/11136) of this code, I think 
this method is very important.
   
   
   
   
   
   



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