RockteMQ-AI commented on issue #11389: URL: https://github.com/apache/rocketmq/issues/11389#issuecomment-6137267534
**Issue Evaluation** Category: `type/bug` | Status: **Confirmed** The reported issue has been verified against the current codebase (commit `a7edeecfb`). **Root Cause:** In `ConsumerLagCalculator`, both `getConsumerLagStats(group, topic, isPop)` and `getInFlightMsgStats(group, topic, isPop)` use `Long.MAX_VALUE` as a "no timestamp" sentinel. The normalization (`if value == Long.MAX_VALUE → 0`) is applied at the end of the normal path, but the early return for `group == null || topic == null` skips it, returning the raw sentinel. In `processAllGroup()`, when a POP group's retry topic does not yet exist (`selectTopicConfig(retryTopic) == null`), `null` is passed as `retryTopic`, which triggers this early-return path. The downstream `getLagLatency()` then computes `System.currentTimeMillis() - Long.MAX_VALUE ≈ -9.22e18`. **Impact:** The exported `rocketmq_consumer_lag_latency` and `rocketmq_consumer_queueing_latency` metrics carry a value around −292 million years for any POP group that has not yet created its retry topic. This destroys dashboards and alerts that aggregate (mean/max/percentile) over those labels. **Severity:** medium — monitoring/metrics correctness, no impact on message delivery. **Affected code:** - `broker/src/main/java/org/apache/rocketmq/broker/metrics/ConsumerLagCalculator.java` — `getConsumerLagStats()` and `getInFlightMsgStats()` early-return paths. An automated fix proposal will be generated. Reply `/approve` to proceed with PR generation, `/revise` to request changes to the approach, or `/reject` to decline. --- *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: [email protected] For queries about this service, please contact Infrastructure at: [email protected]
