Aias00 opened a new issue, #10778: URL: https://github.com/apache/rocketmq/issues/10778
### Before Creating the Bug Report - [x] I have searched the existing issues and pull requests. ### Runtime platform environment N/A ### RocketMQ version develop branch ### JDK Version N/A ### Describe the Bug `MessageQueuePenalizer.selectLeastPenaltyWithPriority()` delegates each priority bucket to `selectLeastPenalty()` and immediately dereferences the returned pair. `selectLeastPenalty()` explicitly returns `null` when the queue list is null or empty. Therefore, if `queuesWithPriority` contains an empty bucket before or between non-empty buckets, `selectLeastPenaltyWithPriority()` throws `NullPointerException` instead of skipping that bucket or returning a stable empty result. ### Steps to Reproduce 1. Call `selectLeastPenaltyWithPriority()` with more than one priority group. 2. Include an empty priority group, for example `[[], [queue-0]]`. 3. Observe that the method dereferences `queueAndPenalty.getRight()` even though `queueAndPenalty` is null. ### What Did You Expect to See? Empty priority groups should be ignored. If all priority groups are empty, the method should return `null`, matching `selectLeastPenalty()` behavior. ### What Did You See Instead? `NullPointerException` can be thrown when a priority bucket is empty. ### Additional Context This is a small runtime robustness issue in Proxy route queue selection. -- 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]
