sijie commented on a change in pull request #7841:
URL: https://github.com/apache/pulsar/pull/7841#discussion_r475927230



##########
File path: 
pulsar-broker/src/main/java/org/apache/pulsar/broker/service/AbstractTopic.java
##########
@@ -140,6 +141,38 @@ protected boolean isProducersExceeded() {
         return false;
     }
 
+    protected boolean isConsumersExceededOnTopic() {
+        Policies policies;
+        try {
+            // Use getDataIfPresent from zk cache to make the call 
non-blocking and prevent deadlocks
+            policies = 
brokerService.pulsar().getConfigurationCache().policiesCache()
+                    .getDataIfPresent(AdminResource.path(POLICIES, 
TopicName.get(topic).getNamespace()));
+
+            if (policies == null) {
+                policies = new Policies();
+            }
+        } catch (Exception e) {

Review comment:
       should we log an error message?




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

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


Reply via email to