Palaiologos1453 opened a new pull request, #11056: URL: https://github.com/apache/rocketmq/pull/11056
### Which Issue(s) This PR Fixes - Fixes #11055 ### Brief Description Aggregate Lite group info queries pass `topK` directly to a `PriorityQueue` constructor. Zero or negative values are invalid, and large positive values can request an unbounded initial array allocation. Validate `topK` before either lag calculator is called and return `INVALID_PARAMETER` unless it is between 1 and 10,000, reusing the processor's existing `MAX_RETURN_COUNT` limit. The check applies only when no specific LiteTopic is requested. Single-topic detail queries continue to accept the default `topK`, since they do not use the TopK calculators. ### How Did You Test This Change? With Amazon Corretto 8u482 and Maven 3.9.11: ```sh mvn -B -pl broker -am -Dtest=LiteManagerProcessorTest,LiteConsumerLagCalculatorTest -DfailIfNoTests=false test ``` - 34 tests passed, with no failures, errors, or skips; the configured Checkstyle and SpotBugs checks passed. - The new invalid-parameter regression fails against the unmodified processor and passes with the fix. It checks null/empty LiteTopic, zero/negative/oversized `topK`, and that rejected requests never call the lag calculator. - Accepted boundaries (1 and 10,000) are covered, and the existing specific-topic test now omits `setTopK` to cover its default value. - `git diff --check` passed. No live-cluster test was run. -- 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]
