Skip to content

fix(remoting): report version 0 for consumer groups without connections - #11148

Open
zjncs wants to merge 1 commit into
apache:developfrom
zjncs:fix/consumer-connection-min-version
Open

zjncs wants to merge 1 commit into
apache:developfrom
zjncs:fix/consumer-connection-min-version

Conversation

@zjncs

@zjncs zjncs commented Sep 11, 2026

Copy link
Copy Markdown

Motivation

ConsumerConnection.computeMinVersion kept its Integer.MAX_VALUE sentinel when the connection set was empty, so mqadmin consumerProgress printed HighestVersion (2147483647) for idle consumer groups whose clients had all disconnected.

Modifications

Return 0 for an empty set instead.

Verification

Fail-before (new test, run against the unpatched code):

ConsumerConnectionTest#testComputeMinVersionWithNoConnection
java.lang.AssertionError: expected: 0 but was: 2147483647

Pass-after:

Tests run: 3, Failures: 0, Errors: 0, Skipped: 0 -- ConsumerConnectionTest

computeMinVersion kept its Integer.MAX_VALUE sentinel when the
connection set was empty, so mqadmin consumerProgress printed
HighestVersion (2147483647) for idle consumer groups whose clients had
all disconnected. Return 0 for an empty set instead.
Copilot AI lite review requested due to automatic review settings September 11, 2026 07:14

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot was unable to review this pull request because the user who requested the review has reached their quota limit.

@RockteMQ-AI RockteMQ-AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Summary

Fix computeMinVersion to return 0 when the connection set is empty, instead of returning Integer.MAX_VALUE. A consumer group with no live connections should not be reported as having the highest version.

LGTM — clean edge case fix with test.


Automated review by github-manager-bot

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants