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 2021/12/30 04:28:08 UTC

[GitHub] [pulsar] lightzhao commented on a change in pull request #13558: fix NPE when updatePublishDispatcher

lightzhao commented on a change in pull request #13558:
URL: https://github.com/apache/pulsar/pull/13558#discussion_r776564119



##########
File path: pulsar-broker/src/main/java/org/apache/pulsar/broker/service/AbstractTopic.java
##########
@@ -883,7 +883,7 @@ private void updatePublishDispatcher(Optional<Policies> optPolicies) {
 
         //topic-level policy is not set, try to use namespace-level rate policy
         final String clusterName = brokerService.pulsar().getConfiguration().getClusterName();
-        final PublishRate publishRate = policies.publishMaxMessageRate != null
+        final PublishRate publishRate = policies !=null && policies.publishMaxMessageRate != null

Review comment:
       There is no NPE case in the production environment,But I see that the logic of the code below is judged to be null.
   [// attach the resource-group level rate limiters, if set
           String rgName = policies != null && policies.resource_group_name != null
             ? policies.resource_group_name
             : null;]




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