You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@pulsar.apache.org by GitBox <gi...@apache.org> on 2022/03/04 04:04:56 UTC

[GitHub] [pulsar] Jason918 commented on a change in pull request #14503: [Broker] Fixed wrong behaviour caused by not cleaning up topic policy service state.

Jason918 commented on a change in pull request #14503:
URL: https://github.com/apache/pulsar/pull/14503#discussion_r819248497



##########
File path: pulsar-broker/src/main/java/org/apache/pulsar/broker/service/SystemTopicBasedTopicPoliciesService.java
##########
@@ -373,6 +361,18 @@ private void initPolicesCache(SystemTopicClient.Reader<PulsarEvent> reader, Comp
         });
     }
 
+    private void cleanCacheAndCloseReader(NamespaceName namespace, boolean cleanOwnedBundlesCount) {
+        CompletableFuture<SystemTopicClient.Reader<PulsarEvent>> readerFuture = readerCaches.remove(namespace);
+        policiesCache.entrySet().removeIf(entry -> entry.getKey().getNamespaceObject() == namespace);

Review comment:
       `equals` instead of `==` ?




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

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