Skip to content

adopt(prometheus-mantine-ui): needs owner decision: no race found; a ready fix for the query tree's duplicate leaf requests - #163

Open
MeharPro wants to merge 2 commits into
mainfrom
claude/bold-faraday-i2fpxs
Open

MeharPro wants to merge 2 commits into
mainfrom
claude/bold-faraday-i2fpxs

Conversation

@MeharPro

@MeharPro MeharPro commented Nov 3, 2026

Copy link
Copy Markdown
Contributor

Status: needs owner decision.

I hunted for races in the Prometheus 3.x web UI (web/ui/mantine-ui, prometheus/prometheus main at 4a933f8) and found none.

  • Coverage: seven scenarios (query tree, table, graph, format, Targets and Service discovery pool switch, delete double-click). Each ran as an explore session at 300, 600 and 900 ms, plus 8 loads without GenClass where the superseded request was held 900 ms.
  • Oracle: the page matched a fresh load of the final state in 224 of 224 page loads (126 of them seeded reorderings).
  • Explore's verdicts: it printed RACE 7 times, and all 7 are false reports (explained below).

Separately, I found a real non-race bug: the query tree view sends each leaf node's /api/v1/query twice and aborts the first. There is a two-line fix with a Vitest test. GenClass did not find this as a race, so the owner decides whether it is worth sending as a plain bug fix.

Files

  • docs/adoption/hunts/prometheus-mantine-ui.md: the report (setup, scenarios, results table, every explore line classified, why the UI does not race, the duplicate request, GenClass problems, time spent, how to reproduce).
  • docs/adoption/hunts/prometheus-mantine-ui.patch: the fix and test against upstream 4a933f89fa96c56ad69e7c02dc5f40e06d93440e, 59 changed lines.
  • docs/adoption/hunts/prometheus-mantine-ui-issue.md: the pull request draft in Prometheus' template, plus an optional bug_report.yml issue, the disclosure paragraph and the "before sending" checklist.
  • docs/adoption/hunts/prometheus-mantine-ui/: the harness (hunt.mjs, run-all.sh, requests.mjs, summarise.mjs), the hunt's prometheus.yml and rules.yml, results/ (28 files, 384 KB in all, each under 30 KB) and summaries/.
  • docs/adoption/hunts/README.md: one new row.

To send (only if the owner says yes)

  1. From a personal account, fork prometheus/prometheus.
  2. Branch from current main and apply the patch.
  3. Reproduce by hand. Either open the tree view with the network panel open and see 7 requests with 2 cancelled, then 5 after the fix; or run requests.mjs against both builds.
  4. Run the test both ways and the suite: pnpm --filter @prometheus-io/mantine-ui exec vitest run src/pages/query/TreeNode.test.tsx, then CI=true pnpm run test and pnpm run lint in web/ui.
  5. Commit with git commit -s (DCO, the sender's own name).
  6. Open the PR titled ui: send each query tree node's request once, using the body in prometheus-mantine-ui-issue.md. It addresses the web/ui owner (juliusv) as CONTRIBUTING.md asks for trivial fixes. No issue is needed first.
  7. Before sending, re-check open PR ui: respect evaluation time in Explain and query tree prometheus/prometheus#20279. It changes the same key without fixing the duplicate. If it has merged, the test needs endTime={null}; the patch was checked on its head.
  8. If asked how it was found: the browser's request log during the hunt. Explore only listed it as a request count that differs.

Measured

  • Duplicate request (requests.mjs, plain Playwright, vite preview production builds, 8 loads each):

    build requests per load (5 tree nodes) aborted, all 8 loads
    main 7, in 8 of 8 loads 16
    with the fix 5, in 8 of 8 loads 0
  • Test: on main it fails 3 of 3 runs; with the fix it passes 3 of 3. The full UI suite passes (18 files, 208 tests); eslint, prettier and tsc are clean.

  • Hunt (seed 1, 6 seeded runs per session, slow_ms 300/600/900):

    scenario explore verdict oracle matched reference
    tree, table, graph, format "no race" at every latency 8 of 8 per session
    delete "no race" at 300 and 600 ms; RACE 3 of 6 at 900 ms 8 of 8 per session
    Targets, Service discovery RACE 6 of 6 at every latency 8 of 8 per session
    each scenario without GenClass (no explore) 8 of 8
  • False-report rate on the correct app: all 7 RACE verdicts (42 of 126 seeded runs) are false.

    • Targets and Service discovery (36 runs): a form field named by an id Mantine generates at random on every page load.
    • Delete at 900 ms (3 runs, one verdict): one line of TSDB status page text comes from a tie the server breaks in its top-10 list.

Problems with GenClass itself (report section 9)

  1. Form fields are named by their id. Ids generated at random per load (Mantine's useId) cause false RACE verdicts: 6 sessions, 36 of 36 seeded runs. The baselines' noise filter removes exact names, not the shape.
  2. A streaming fetch blocks the schedule. The UI's notifications stream (fetch-event-source) holds up delivery for its first 10 s, so 3 to 5 holds run out per load, baselines included (624 in 168 loads). With the stream blocked: 0 in 4 of 4 loads, and each load took about 7 s instead of about 16 s. Suggested: treat text/event-stream responses as delivered once their headers arrive.
  3. A server-side difference in one line of page text reads as a race (1 verdict).
  4. Docs: the Gitea harness that swarm.md points to uses the older GenClass.init/data-manual injection, while Ghost's uses GENCLASS_CONFIG.

Time

About 2 h 15 min. The 50-minute matrix ran in the background while I worked on the fix, test and drafts.

The branch is claude/bold-faraday-i2fpxs, the session's assigned branch, instead of adopt/prometheus-mantine-ui. Nothing was sent to any other repository.


Generated by Claude Code

… progress)

The race hunt on the Prometheus web UI (web/ui/mantine-ui): the harness,
the first sessions' results, the duplicate-request fix and its test as a
patch, and the pull request draft. The report's results sections are filled
in by the next commit, when the remaining sessions have run.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01Fqwfq2rZJASoQ4owhyDZp2
…sults and report

All 28 sessions (21 explore sessions at 300, 600 and 900 ms and 7 runs
without GenClass, 224 page loads): the page matched a fresh load of the
final state in 224 of 224. Explore's seven RACE verdicts are false reports
(form fields named by per-load random ids; a server-side tie in the TSDB
status top-10), written up with GenClass's other problems. The tree view's
duplicate leaf request is a non-race fix left to the owner.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01Fqwfq2rZJASoQ4owhyDZp2

This branch has not been deployed

No deployments
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.

2 participants