Skip to content

fix(tieredstore): report dispatch metric collection failures - #11167

Open
ForIt111 wants to merge 1 commit into
apache:developfrom
ForIt111:fix/tieredstore-dispatch-metric-errors
Open

ForIt111 wants to merge 1 commit into
apache:developfrom
ForIt111:fix/tieredstore-dispatch-metric-errors

Conversation

@ForIt111

Copy link
Copy Markdown

Which Issue(s) This PR Fixes

Brief Description

Log ConsumeQueueException while collecting the Tiered Store dispatchBehind and dispatchLatency gauges. This preserves the existing callback behavior while exposing collection failures to operators with the exception stack trace.

How Did You Test This Change?

  • Passed git diff --check.
  • Attempted mvn -pl tieredstore -am -DskipITs test, but this environment does not have Maven or a Java runtime installed, so the module tests could not run locally.

…ures

Signed-off-by: lintao <ForIt_123456@outlook.com>
@RockteMQ-AI

Copy link
Copy Markdown
Contributor

🔍 Code Review — PR #11167

Verdict: ✅ Looks good

This is a clean, minimal fix that addresses the silent exception swallowing described in #11166.

Analysis

Aspect Assessment
Correctness log field is properly declared at L79 as private static final Logger via LoggerFactory
Consistency ✅ Follows the existing pattern at L307 (log.error("Failed to get storage size", e))
Error messages ✅ Descriptive — each message identifies which metric failed (dispatch-behind / dispatch-latency)
Behavior preservation ✅ Catch blocks still exist; metric recording continues for other gauges even if one fails
Scope ✅ Minimal — 2 lines changed, 1 file, no unrelated modifications

Minor Observations

  1. No test coverage — The PR description notes that Maven/Java was not available locally. Consider adding a unit test that verifies the log.error path is exercised when ConsumeQueueException is thrown, to prevent regression.

  2. Metrics still report stale values on failure — When the exception is caught and logged, the gauge simply does not record a new value for that collection cycle. This is acceptable behavior, but worth documenting in the PR description or a code comment for future maintainers.

Neither observation blocks this fix. The change is a clear improvement over silently dropping exceptions.


Automated review by @RockteMQ-AI · Please verify suggestions before applying.

@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

Replaces two // TODO: handle exception comments with proper log.error() calls in the tiered store metrics collection. Good fix — silent exception swallowing in metric collectors can hide real issues.

Changes look correct:

  • Descriptive error messages identify which metric failed (dispatch-behind / dispatch-latency)
  • Exception is passed as second argument for full stack trace
  • log.error is the appropriate level for unexpected failures in background metric collection

LGTM.


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.

[Bug] Tiered store dispatch metrics silently ignore ConsumeQueueException

2 participants