lhotari commented on code in PR #24427:
URL: https://github.com/apache/pulsar/pull/24427#discussion_r2297515262


##########
pulsar-broker/src/main/java/org/apache/pulsar/broker/service/SystemTopicBasedTopicPoliciesService.java:
##########
@@ -561,14 +741,16 @@ private void cleanCacheAndCloseReader(@NonNull 
NamespaceName namespace, boolean
      * #{@link SystemTopicBasedTopicPoliciesService#getTopicPoliciesAsync} 
method to block loading topic.
      */
     private void readMorePoliciesAsync(SystemTopicClient.Reader<PulsarEvent> 
reader) {
+        NamespaceName namespaceObject = 
reader.getSystemTopic().getTopicName().getNamespaceObject();
         if (closed.get()) {
-            
cleanCacheAndCloseReader(reader.getSystemTopic().getTopicName().getNamespaceObject(),
 false);
+            cleanCacheAndCloseReader(namespaceObject, false);
             return;
         }
         reader.readNextAsync()
                 .thenAccept(msg -> {
                     try {
                         refreshTopicPoliciesCache(msg);
+                        
getMessageHandlerTracker(namespaceObject).handleMessageId((MessageIdAdv) 
msg.getMessageId());

Review Comment:
   Addressed this by both catching exceptions for `future.complete(null)` and 
putting `notifyListener` in a finally block.



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