[ISSUE #10492] Add debug logging for swallowed exceptions in StatsAllSubCommand#10493
Open
SGloria wants to merge 1 commit into
Open
[ISSUE #10492] Add debug logging for swallowed exceptions in StatsAllSubCommand#10493SGloria wants to merge 1 commit into
SGloria wants to merge 1 commit into
Conversation
…atsAllSubCommand Previously, multiple catch blocks in StatsAllSubCommand silently swallowed exceptions, making it difficult to diagnose issues when the `mqadmin statsAll` command failed to retrieve statistics from certain brokers. This commit adds debug-level logging to all empty catch blocks, recording the exception details along with contextual information (topic, group, broker address) to improve observability. Co-authored-by: Cursor <cursoragent@cursor.com>
RongtongJin
approved these changes
Jun 13, 2026
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## develop #10493 +/- ##
=============================================
- Coverage 49.03% 48.06% -0.98%
+ Complexity 13471 13328 -143
=============================================
Files 1375 1377 +2
Lines 100381 100712 +331
Branches 12965 13010 +45
=============================================
- Hits 49223 48404 -819
- Misses 45172 46359 +1187
+ Partials 5986 5949 -37 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
catch (Exception e)blocks inStatsAllSubCommand.javamqadmin statsAllcommand when partial failures occurMotivation
When using
mqadmin statsAll, if some brokers are temporarily unavailable or return errors, exceptions are silently swallowed. Operators have no way to know whether the output is complete or partially missing. By adding debug-level logging, we preserve the existing behavior (no visible output change by default) while enabling troubleshooting when needed.Changes
tools/src/main/java/org/apache/rocketmq/tools/command/stats/StatsAllSubCommand.java:Loggerfield usingLoggerFactorylog.debug(...)with exception details in all 4 previously empty catch blocksTest Plan
Fixes #10492