This is an automated email from the ASF dual-hosted git repository.

lizhimin pushed a commit to branch develop
in repository https://gitbox.apache.org/repos/asf/rocketmq.git


The following commit(s) were added to refs/heads/develop by this push:
     new af6a95f4c5 [ISSUE #6627] Fix ConsumerLagCalculator#processAllGroup 
retry topic NPE (#6628)
af6a95f4c5 is described below

commit af6a95f4c5b9bc468e2d152e225935c2f1e6309c
Author: Zhouxiang Zhan <[email protected]>
AuthorDate: Fri Apr 21 15:50:41 2023 +0800

    [ISSUE #6627] Fix ConsumerLagCalculator#processAllGroup retry topic NPE 
(#6628)
---
 .../rocketmq/broker/metrics/ConsumerLagCalculator.java       | 12 +++++++-----
 1 file changed, 7 insertions(+), 5 deletions(-)

diff --git 
a/broker/src/main/java/org/apache/rocketmq/broker/metrics/ConsumerLagCalculator.java
 
b/broker/src/main/java/org/apache/rocketmq/broker/metrics/ConsumerLagCalculator.java
index f2abdba74c..a1afe7e57e 100644
--- 
a/broker/src/main/java/org/apache/rocketmq/broker/metrics/ConsumerLagCalculator.java
+++ 
b/broker/src/main/java/org/apache/rocketmq/broker/metrics/ConsumerLagCalculator.java
@@ -177,12 +177,14 @@ public class ConsumerLagCalculator {
                 if (isPop) {
                     String retryTopic = KeyBuilder.buildPopRetryTopic(topic, 
group);
                     TopicConfig retryTopicConfig = 
topicConfigManager.selectTopicConfig(retryTopic);
-                    int retryTopicPerm = retryTopicConfig.getPerm() & 
brokerConfig.getBrokerPermission();
-                    if (PermName.isReadable(retryTopicPerm) || 
PermName.isWriteable(retryTopicPerm)) {
-                        consumer.accept(new ProcessGroupInfo(group, topic, 
true, retryTopic));
-                    } else {
-                        consumer.accept(new ProcessGroupInfo(group, topic, 
true, null));
+                    if (retryTopicConfig != null) {
+                        int retryTopicPerm = retryTopicConfig.getPerm() & 
brokerConfig.getBrokerPermission();
+                        if (PermName.isReadable(retryTopicPerm) || 
PermName.isWriteable(retryTopicPerm)) {
+                            consumer.accept(new ProcessGroupInfo(group, topic, 
true, retryTopic));
+                            continue;
+                        }
                     }
+                    consumer.accept(new ProcessGroupInfo(group, topic, true, 
null));
                 } else {
                     consumer.accept(new ProcessGroupInfo(group, topic, false, 
null));
                 }

Reply via email to