Skip to content

Commit

Permalink
[ISSUE apache#6627] Fix ConsumerLagCalculator#processAllGroup retry t…
Browse files Browse the repository at this point in the history
…opic NPE
  • Loading branch information
drpmma committed Apr 21, 2023
1 parent ea8b9d9 commit a1a4dbf
Showing 1 changed file with 7 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -177,12 +177,14 @@ private void processAllGroup(Consumer<ProcessGroupInfo> consumer) {
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));
}
Expand Down

0 comments on commit a1a4dbf

Please sign in to comment.