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/03 03:23:42 UTC

[PR] fix(topic): stop presenting a failed detail load as "the broker has no route" [rocketmq-dashboard]

unbridled-41 opened a new pull request, #5442:
URL: https://github.com/apache/rocketmq-dashboard/pull/5442

   ## Problem / Evidence
   
   Opening a topic's detail while a detail request fails claims the topic has no broker route and offers to rebuild it.
   
   - `web/src/pages/instance/topic.tsx:523-546` (pre-fix) awaited `loadTopicConsumers(topic)` **before** the route lookup inside the same `try`, so a rejected consumers request skipped `getTopicRoutes` entirely (the helper itself has no catch).
   - The render then derives everything from the empty fallback: `getRoutes(name)` returns `routesByTopic[name] ?? []` (`:571-573`), `analyzeTopicRoutes([])` returns the critical `NO_ROUTE`, and the alert's action is gated only on `routes.length === 0`, so **在 Broker 上重建** is offered for a topic that exists — clicking it calls `createTopic`, which the server implements as `admin.createAndUpdateTopicConfig` (`RocketMQAdminClientImpl.java:310`), i.e. it rewrites the existing topic's queue counts/perm.
   - The consumer table used the same fallback (`?? { items: [], total: 0 }`), rendering an empty "no consumers" table with only a transient toast for the failure.
   
   Reproduction: open the topic page and click 详情 while `GET /topics/{name}/consumers/page` or `GET /topics/{name}/routes` returns a 5xx.
   
   ## Root cause / Fix
   
   "Not loaded" and "loaded and empty" were indistinguishable in the detail modal. Fix: load the two independently, track failures per request kind, and render the truth:
   
   - a failed route lookup shows `路由诊断:加载失败` with a retry action, and no rebuild button;
   - a failed consumer page labels its empty table (`消费者加载失败,请重试`) instead of implying nobody consumes the topic.
   
   ## Priority & scoring
   
   PRIORITY 68 = 影响 28 (a transient failure is reported as a definitive broker-state verdict, and the offered action rewrites a live topic's config) + 波及 10 (topic detail for every topic) + 可复现 16 (deterministic given a failing request) + 维护价值 14 (reuses the failure-state pattern the pages already have).
   
   FIX_CONFIDENCE 80: two flags and the existing alert/table affordances; pinned by two regressions.
   
   ## Tests
   
   ```
   cd web && npx vitest run src/pages/instance/__tests__/TopicPage.test.tsx
   ```
   
   - Red before the fix: `still loads the routes when the consumer page fails…` fails (`getTopicRoutes` is never called) and `shows a retry instead of the rebuild action when the route request itself failed` fails (`Unable to find an element with the text: 路由诊断:加载失败`).
   - Green after: `Tests 36 passed (36)`.
   - `npx tsc -b` and `npx eslint` on both files: clean.
   
   ## Risk
   
   Low. Only the failure states change; the healthy path (routes and consumers load, diagnosis renders as before) is untouched.


-- 
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(topic): stop presenting a failed detail load as "the broker has no route" [rocketmq-dashboard]

Posted by "unbridled-41 (via GitHub)" <gi...@apache.org>.
unbridled-41 commented on PR #5442:
URL: https://github.com/apache/rocketmq-dashboard/pull/5442#issuecomment-5965538637

   ### CI attribution: `Frontend Build (Node 20)` fails in the license gate, independent of this diff
   
   The job compiles the bundle and then fails the post-build license verification:
   
   ```
   dist/assets/index-bbQgj2Wj.js   356.61 kB
   ✓ built in 10.95s
   > rocketmq-studio-web@3.0.0 license:check
   license gate: build artifact verification failed: assets/index-bbQgj2Wj.js
   ```
   
   That gate compares the written `dist/` against the recorded license manifest and fails the same way on
   branches that change no frontend code at all — a docs-only PR of this batch fails it with
   `license gate: build artifact verification failed: assets/index-CcP1KOri.js` (run 37088829422) — and
   on `rocketmq-studio` itself. It is being addressed independently by #5346. The frontend suite, `tsc -b`
   and `eslint` results that belong to this change are in the Tests section above and are green.
   


-- 
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(topic): stop presenting a failed detail load as "the broker has no route" [rocketmq-dashboard]

Posted by "lizhimins (via GitHub)" <gi...@apache.org>.
lizhimins merged PR #5442:
URL: https://github.com/apache/rocketmq-dashboard/pull/5442


-- 
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