You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@rocketmq.apache.org by "unbridled-41 (via GitHub)" <gi...@apache.org> on 2026/10/09 17:55:44 UTC
[PR] fix(consumer): stop presenting an unmeasurable consume delay as 0 seconds [rocketmq-dashboard]
unbridled-41 opened a new pull request, #5920:
URL: https://github.com/apache/rocketmq-dashboard/pull/5920
### Which Issue(s) This PR Fixes
Fixes #5919
### Problem / Evidence
The provider leaves `delaySeconds` at its zero default when it cannot compute a delay and says so through a second field (`RocketMQMetadataProvider`: `int delaySeconds = 0; boolean timestampAvailable = false;` ... `// No consume stats (e.g. POP-only group without an offset table): keep zeros.`; `ConsumerGroupVO.consumptionTimestampAvailable` = "Whether broker consume stats include a consumed-message timestamp for delay calculation"). The console never read it (`web/src` has no reference to the field), so the column and the drawer rendered `formatDelay(0)` = `0秒` - "fully caught up" - and the sort key was that zero:
```
ConsumerPage: reports a group without a consumed-message timestamp as an unknown delay
TestingLibraryElementError: Unable to find an element with the text: 不可用
```
The sibling columns of the same table already treat "not measured" explicitly: `totalLag`/`onlineInstances` arrive as `-1` and render 不可用 (`utils/consumerLag.ts`, `consumerConnections.ts`).
### Root cause / Fix
A placeholder zero consumed as a measurement. Declare the flag on the client type, render 不可用 when it is false (column and drawer), and give the column a direction-aware sort key so unmeasured rows stay after measured ones in both orders - the same treatment the other columns of this page got.
### Priority and scoring
**PRIORITY 55** — impact 18/40 (a group that may be lagging is presented as caught up, in the list, the drawer and the order), blast radius 12/20 (groups without a consumed-message timestamp, e.g. POP-only ones), reproducibility 18/20 (deterministic, pinned by the new test), maintenance value 7/20.
**FIX_CONFIDENCE 85** — the flag exists precisely for this decision and the pattern is already used by two sibling columns.
### Tests
`cd web && npx vitest run src/pages/instance/__tests__/ConsumerPage.test.tsx` -> `Tests 48 passed`.
| Test | Before | After |
|---|---|---|
| `reports a group without a consumed-message timestamp as an unknown delay` | FAIL (row shows `0秒`, no 不可用) | PASS |
The new case also asserts the drawer and that a descending sort does not promote the unmeasured row. `npx eslint` reports no errors; `npx tsc -b` passes.
### Risk
Only groups whose delay is explicitly flagged as unmeasured change; providers that do not send the flag (cloud providers, mock) keep today's rendering because the check is `=== false`.
--
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: [PR] fix(consumer): stop presenting an unmeasurable consume delay as 0 seconds [rocketmq-dashboard]
Posted by "unbridled-41 (via GitHub)" <gi...@apache.org>.
unbridled-41 commented on PR #5920:
URL: https://github.com/apache/rocketmq-dashboard/pull/5920#issuecomment-6091338721
### Verification on the final commit (branch + commit + command results)
Every command from the description re-run on a fresh worktree of this branch (`git worktree add <dir> fork/<branch>`, no local modifications), at commit `bd7799715f`:
| command | exit | result |
| --- | --- | --- |
| `cd web && npx vitest run src/pages/instance/__tests__/ConsumerPage.test.tsx` | 0 | `Test Files 1 passed (1) · Tests 48 passed (48)` |
CI note: on this repository the `Backend Build` (binary-license-gate), `Frontend Build` / `Frontend Docker Build` (licence manifest) and `rmqctl Build` (YAML renderer quoting) jobs are red for every branch, trunk included; the module-level commands above are unaffected.
--
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: [PR] fix(consumer): stop presenting an unmeasurable consume delay as 0 seconds [rocketmq-dashboard]
Posted by "unbridled-41 (via GitHub)" <gi...@apache.org>.
unbridled-41 commented on PR #5920:
URL: https://github.com/apache/rocketmq-dashboard/pull/5920#issuecomment-6268050913
Rebased the branch on the current `rocketmq-studio` (merge commit `b6b38728`) to clear the conflict with #5926's total-lag handling in the same CSV export.
Resolution: keep both columns' unavailable handling — `totalLag` renders `unknown` when `isLagAvailable` is false (from the base), and `delaySeconds` renders `unknown` when `consumptionTimestampAvailable` is false (this PR). Both regression tests are kept.
Verified at `b6b38728`: `npx vitest run src/services/consumerService.test.ts` → 29 tests, 0 failures.
--
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: [PR] fix(consumer): stop presenting an unmeasurable consume delay as 0 seconds [rocketmq-dashboard]
Posted by "unbridled-41 (via GitHub)" <gi...@apache.org>.
unbridled-41 commented on PR #5920:
URL: https://github.com/apache/rocketmq-dashboard/pull/5920#issuecomment-6091169396
### Sibling note: the backlog placeholder is #5926, and the two branches conflict
Symmetric to the note on #5926: that PR handles `consumeStatsAvailable=false` (backlog 0), this one `consumptionTimestampAvailable=false` (delay 0), and both encode "the console must not read the provider's placeholder as a measurement" — two independent flags of the same `GroupLiveSnapshot`.
A trial merge of the two branches conflicts in 4 files (6 hunks): `web/src/api/metadata.ts`, `web/src/pages/instance/consumer.tsx`, `web/src/pages/instance/__tests__/ConsumerPage.test.tsx`, `web/src/utils/consumerGroupDiagnostics.test.ts`. Every hunk resolves to "keep both" (both optional fields, both sort helpers, both diagnostics issues, both tests). I resolved that merge locally to check the combination:
```
cd web && npx tsc -b # clean
cd web && npx vitest run src/utils/consumerGroupDiagnostics.test.ts \
src/services/consumerService.test.ts src/pages/instance/__tests__/ConsumerPage.test.tsx
Test Files 3 passed (3)
Tests 78 passed (78) # this PR's cases and #5926's cases together
```
Either merge order works; the second branch to land needs a rebase, which is mechanical — happy to do it once the other one is merged.
--
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: [PR] fix(consumer): stop presenting an unmeasurable consume delay as 0 seconds [rocketmq-dashboard]
Posted by "unbridled-41 (via GitHub)" <gi...@apache.org>.
unbridled-41 commented on PR #5920:
URL: https://github.com/apache/rocketmq-dashboard/pull/5920#issuecomment-6086376555
### CI status of this PR
`Backend Tests (Java 21)` — still running at the time of writing; the change-specific commands and their results are in the Tests section of the description.
The four remaining red jobs are red for every branch, including `rocketmq-studio` itself:
- `Backend Build (Java 21)` — the `binary-license-gate` antrun step fails on a list of third-party jars (`spring-ai-*`, `swagger-ui`, `tencentcloud-sdk-*`, `zstd-jni`, ... : "missing complete upstream LICENSE/COPYING; a POM name or link is not a substitute"). This PR touches no build configuration; tracked by #5341.
- `Frontend Build (Node 20)` / `Frontend Docker Build` — the frontend licence manifest check fails the same way on branches that do not touch `web/` at all; tracked by #5346.
- `rmqctl Build (Go)` — `cmd` `TestMessageQueryCompletenessWarningTest` yaml subtests: `got {"items":[{"size":"3",...}]}, want {"size":3,...}`, i.e. the YAML renderer writes numbers as quoted strings where the test expects integer literals. Reproduced locally with `cd rmqctl && go test ./cmd/` from a checkout whose `rmqctl/` tree is byte-identical to `rocketmq-studio`'s, and owned by open PR #5850 ("keep yaml numbers unquoted").
--
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: [PR] fix(consumer): stop presenting an unmeasurable consume delay as 0 seconds [rocketmq-dashboard]
Posted by "unbridled-41 (via GitHub)" <gi...@apache.org>.
unbridled-41 commented on PR #5920:
URL: https://github.com/apache/rocketmq-dashboard/pull/5920#issuecomment-6091060070
### Follow-up review of this fix: two more places still read the placeholder as a measurement
The table column and the detail dialog now say the delay is unknown, but two other consumers of the same field still presented the provider's placeholder zero as a measurement:
1. `web/src/utils/consumerGroupDiagnostics.ts` — the health analysis coerced `delaySeconds` to `0` and compared it against the delay thresholds, so a group whose delay could not be measured produced no `HIGH_CONSUME_DELAY` issue and was reported as healthy/caught up. It now emits an explicit `CONSUME_DELAY_UNKNOWN` warning (same shape as the existing `UNKNOWN_QUEUE_LAG` issue) and adds the matching recommendation, while a measured delay is judged exactly as before.
2. `web/src/services/consumerService.ts` — the group CSV export wrote the placeholder as `Delay Seconds = 0`, i.e. "caught up" in a file an operator keeps. It now writes `unknown`, the same convention the neighbouring `Online Instances` column already uses for its unavailable sentinel.
Commit `bd779971` contains both (first commit `67ec90b7` untouched, no force-push). The check is deliberately `consumptionTimestampAvailable === false`, so a payload that omits the optional field keeps its previous behaviour.
Tests added: `reports an unmeasurable consume delay as unknown instead of a healthy zero` and `keeps judging a measured delay` (`consumerGroupDiagnostics.test.ts`), and `renders an unmeasurable consume delay as unknown instead of the placeholder zero` (`consumerService.test.ts`, which also pins that a *measured* zero stays numeric).
Red/green, both observed locally:
```
# with the diagnostics and CSV changes reverted
cd web && npx vitest run src/utils/consumerGroupDiagnostics.test.ts src/services/consumerService.test.ts
Tests 2 failed | 26 passed (28)
# with bd779971
cd web && npx vitest run src/utils/consumerGroupDiagnostics.test.ts src/services/consumerService.test.ts src/pages/instance/__tests__/ConsumerPage.test.tsx
Test Files 3 passed (3)
Tests 76 passed (76)
```
`npx tsc -b` and `npx eslint` on the four touched files are clean.
Branch `fix/consumer-delay-unavailable`, HEAD `bd779971` (on top of `67ec90b7`).
--
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