yyqdbngt opened a new pull request, #10732:
URL: https://github.com/apache/rocketmq/pull/10732
### Motivation
Four bugs found by code review:
1. **`CommitLog.getBulkData` can loop forever**
(`store/src/main/java/org/apache/rocketmq/store/CommitLog.java`)
When `findMappedFileByOffset` returns `null` (offset below the first
mapped file or in a deleted-file gap), the loop body does nothing — neither
`remainSize` nor `startOffset` advances and there is no `else break`. The
calling thread (e.g. replication checksum) spins forever. Added a warning log
and `break`.
2. **`ConsumerManager` records the topic instead of the group**
(`broker/src/main/java/org/apache/rocketmq/broker/client/ConsumerManager.java`)
In both `registerConsumer` and `registerConsumerWithoutSub`,
`groups.add(subscriptionData.getTopic())` added the topic name into the `topic
→ Set<group>` map instead of the consumer group. `clearTopicGroupTable` already
removes `groupInfo.getGroupName()` from the same sets, confirming they should
hold group names. `queryTopicConsumeByWho` therefore returns the wrong groups.
Changed to `groups.add(group)`.
3. **`PopReviveService` throws `ConcurrentModificationException` while
committing offsets**
(`broker/src/main/java/org/apache/rocketmq/broker/processor/PopReviveService.java`)
The loop removed entries via `inflightReviveRequestMap.remove(oldCK)`
while iterating the fail-fast `TreeMap` iterator, so two consecutive finished
checkpoints threw CME and aborted the offset-commit loop, risking duplicate
redelivery. Switched to `iterator.remove()`.
4. **`Broker2Client.getConsumeStatus` NPE for offline groups**
(`broker/src/main/java/org/apache/rocketmq/broker/client/net/Broker2Client.java`)
`getConsumerGroupInfo(group)` returns `null` when the group has no
connected consumers; dereferencing it threw NPE on the `GET_CONSUMER_STATUS`
admin RPC. Guarded the null case.
### Verification
`mvn -pl broker -am compile` passes (both locally and on the build server).
### Diff
4 files changed, +14 / -6.
--
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: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]