You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@rocketmq.apache.org by "SGloria (via GitHub)" <gi...@apache.org> on 2026/06/12 14:03:06 UTC
[I] [Enhancement] Add logging for swallowed exceptions in StatsAllSubCommand [rocketmq]
SGloria opened a new issue, #10492:
URL: https://github.com/apache/rocketmq/issues/10492
### Before Creating the Enhancement Request
- [x] I have confirmed that this should be classified as an enhancement rather than a bug/feature.
### Summary
In `tools/src/main/java/org/apache/rocketmq/tools/command/stats/StatsAllSubCommand.java`, there are multiple empty `catch (Exception e)` blocks (lines 58, 77, 91, 198) that silently swallow exceptions without any logging. This makes it difficult to diagnose issues when the `statsAll` command fails to retrieve statistics from certain brokers.
### Motivation
When using the `mqadmin statsAll` command, if some brokers are temporarily unavailable or return errors, the exceptions are completely hidden. Users and operators cannot tell whether the statistics output is complete or partially missing due to errors. Adding at least debug-level logging would significantly improve observability and debugging experience.
### Describe the Solution You'd Like
Add `log.debug()` or `log.warn()` calls in the empty catch blocks to record the exception information, so that operators can enable debug logging to troubleshoot missing statistics data.
### Describe Alternatives You've Considered
One alternative is to accumulate errors and print a summary at the end of the command execution, but simple debug logging is less intrusive and more aligned with the existing code style.
### Additional Context
Similar empty catch blocks exist in other command files under `tools/src/main/java/org/apache/rocketmq/tools/command/`, but this issue focuses specifically on `StatsAllSubCommand` as a starting point.
--
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: commits-unsubscribe@rocketmq.apache.org.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [I] [Enhancement] Add logging for swallowed exceptions in StatsAllSubCommand [rocketmq]
Posted by "RockteMQ-AI (via GitHub)" <gi...@apache.org>.
RockteMQ-AI commented on issue #10492:
URL: https://github.com/apache/rocketmq/issues/10492#issuecomment-4704447564
**Issue Evaluation**
Category: `type/enhancement` | Status: **Evaluated**
**Feasibility:** feasible | **Scope:** tools (StatsAllSubCommand) | **Compatibility:** no breaking changes
Valid observation. The empty `catch` blocks in `StatsAllSubCommand` silently swallow exceptions, making it difficult to diagnose issues when statistics collection fails. Adding `log.warn` or `log.error` with the exception context is a simple and low-risk improvement.
The proposed change is straightforward and would improve operational debugging.
---
*Automated evaluation by github-manager-bot*
--
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: commits-unsubscribe@rocketmq.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [I] [Enhancement] Add logging for swallowed exceptions in StatsAllSubCommand [rocketmq]
Posted by "ShannonDing (via GitHub)" <gi...@apache.org>.
ShannonDing closed issue #10492: [Enhancement] Add logging for swallowed exceptions in StatsAllSubCommand
URL: https://github.com/apache/rocketmq/issues/10492
--
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: commits-unsubscribe@rocketmq.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org