Skip to content

Perf CI: end the dashboard wait before the job timeout - #128236

Merged
alexey-milovidov merged 1 commit into
ClickHouse:masterfrom
groeneai:perf-ci-end-dashboard-wait-before-job-timeout
Oct 30, 2026
Merged

alexey-milovidov merged 1 commit into
ClickHouse:masterfrom
groeneai:perf-ci-end-dashboard-wait-before-job-timeout

Conversation

@groeneai

@groeneai groeneai commented Oct 30, 2026 •

Copy link
Copy Markdown
Collaborator

Related: #125734

Changelog category (leave one):

  • CI Fix or Improvement (changelog entry is not required)

Changelog entry (a user-readable short description of the changes that goes into CHANGELOG.md):

Description

Performance Comparison (amd_release, master_head, 4/6) hit the 7200 s job timeout in 5 of 8 master runs on 2026-10-30 and reported nothing (e.g. job 123987608243). While the performance dashboard registered no master runs (2026-10-29 09:04Z to 2026-10-30, a since-resolved CIDB switch), perf_dashboard_gate waited the full 600 s on every shard. That budget counts from the uploads, not from the job's timeout: on 4/6 the report ends 111 minutes in, and praktika kills it during the wait, before judge_without_dashboard (#125734) can judge the shard by its own report.

Change: the job's end is JOB_START + timeout - 300 s, with the timeout read from info.job_config like functional_tests.py does.

  • Uploads get min(600 s, time left), at least 60 s, so a late shard still uploads instead of failing as "not attempted".
  • The gate waits until min(upload deadline, end) and starts no poll after its deadline.
  • The dashboard confirmation rerun is bounded by the same end, and skipped (rows stay blocking) when no time is left.

The 300 s reserve covers a poll in flight (at most 3 x 60 s), the 60 s upload floor and the ~30 s tail. A shard with more than ~15 minutes left keeps the 600 s budget. On the failing job the gate would have given up at 11:22:45, and the shard would have passed on its report (8 too long, 0 slower) about 4.5 minutes before the kill.

4/6 is first because #127241 added a test file, which moved tests between the round-robin shards. Neither that nor the dashboard is changed here.

Validation: a local harness replays the failing job's timings on a fake clock (master: the wait ends 73 s after the kill; this branch: 285 s before it), plus 9 other cases, 7 caught mutations and a live dashboard run.


Workflow [PR]
Sync PR [sync-upstream/pr/128236]

Version info

  • Merged into: 26.11.1.945-master (included in 26.11 and later)

When the performance dashboard does not register a run, `perf_dashboard_gate`
waits its whole 600 s budget, counted from the start of the uploads and
unrelated to the job's 7200 s timeout. A shard whose benchmarks end late
(amd_release master_head 4/6 at ~111 min) is then killed by praktika during
the wait, before `judge_without_dashboard` can judge it by its own report, so
the shard reports no verdict at all (job 123987608243).

Count the job's own time instead: `JOB_START` is taken at import, the job's
timeout is read from `info.job_config`, and `end` = start + timeout - 300 s.
- The uploads get min(600, time left before `end`) seconds, but at least 60 s,
  so a late shard still makes its uploads instead of failing them as "not
  attempted", which the gate would turn into a plain FAIL.
- The gate's deadline is min(upload deadline, `end`), and the gate starts no
  request once its deadline has passed.
- The dashboard confirmation rerun is bounded by `end`, and is skipped (its
  rows stay blocking) when no time is left.
The 300 s reserve covers a poll in flight (<= 3 GETs x 60 s), the uploads'
floor (<= 60 s), a cut confirmation's SIGTERM grace (<= 100 s) and the ~30 s
tail. A job config without a usable timeout now fails at the start of a
non-local master_head run. release_base and local runs are unchanged.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
@groeneai

Copy link
Copy Markdown
Collaborator Author
Internal second-model review: adjudication log (click to expand)

Pre-publication review by an independent model (engine: codex; 2 findings) plus my own review (4 nits).

# Sev Finding Verdict Evidence / action
1 ⚠️ Nightly runs take JOB_START after their wrapper's setup, so end can fall after the real deadline (job_end, main) DISAGREE Measured wrapper lag on nightly job 123278812227: 71 s, inside the 300 s reserve. Nightly runs have no dashboard gate or confirmation (performance_tests.py:3583), so end can only lower their upload budget, never above the previous 600 s.
2 ⚠️ No reviewable evidence that the deadlines hold DISAGREE A local fake-clock harness (not committed: no tests for test infrastructure) replays job 123987608243: on master the wait ends 73 s after the kill, on this branch 285 s before it. It also covers the 600 s budget, the 60 s floor, an expired gate, no poll after the deadline and the skipped or cut confirmation, and catches 7 of 7 mutations.
3 💡 Wording: the docstring's "no request starts" means "no poll starts"; the verdict says "upload budget" also when the job's time ran out AGREE, noted, not blocking none
4 💡 The 60 s floor is shared by all uploads, so a slow first insert can starve the rest AGREE, noted, not blocking Existing classification; all uploads took 20 s on the failing job.

Severity: ❌ blocker / ⚠️ major / 💡 nit. DISAGREE verdicts carry recorded evidence and are terminal per finding.

Session id: cron:clickhouse-review-slot-8:20261030-131900

@groeneai

Copy link
Copy Markdown
Collaborator Author
Pre-PR validation gate (click to expand)
# Question Answer
a Deterministic repro? Yes. A local harness replays job 123987608243's measured timings on a fake clock (uploads 111 min into the 7200 s timer, dashboard never serving): on master the dashboard wait ends 73 s after the kill, on every run.
b Root cause explained? The dashboard gate's 600 s wait counts from the start of the uploads and ignores the job's timeout. With the dashboard stalled, every shard waits the full 600 s, and a shard whose report ends after ~110 min is killed before judge_without_dashboard can judge it.
c Fix matches root cause? Yes. The uploads, the gate and the confirmation rerun are bounded by the time the job has left (timeout - 300 s), so the existing fallback is reached. No timeout is raised and no shard with time to spare gets a shorter budget.
d Test intent preserved / new tests added? Test-infrastructure change: no committed test, per the decision on #119766. Validated by the local harness: 10 cases, a live dashboard run, and 7 code mutations that it catches.
e Both directions demonstrated? Yes. The incident replay, the late-shard, mid-loop-deadline, CIDB-down and confirmation cases fail on master and pass on this branch (gate gives up 285 s before the kill, shard judged OK by its report).
f Fix is general across code paths? All waits in the master_head tail: the dashboard-input uploads (they share upload_deadline), the gate loop and the confirmation rerun. PR runs use the same path. Nightly keeps 600 s (16 h timeout). release_base and local runs are unchanged.
g Fix generalizes across inputs (params/datatypes/wrappers)? Job config as dict, object, None, {}, 0 and a string. Uploads early, late, and past the end. Dashboard serving, not serving, a deadline mid-loop, a deadline already passed. CIDB down.
h Backward compatible? (maintainer-approved exception only) No settings or formats change. The message within 600s becomes within the upload budget; nothing in the tree parses it. A perf job config without a timeout now fails at the start (every current config has one).
i Invariants and contracts preserved? The uploads still start no attempt after their deadline, and the gate now follows the same rule. A skipped confirmation keeps its rows blocking. After the end, at most a poll in flight (<= 180 s) and the tail (~30 s) run, inside the 285 s left before the kill.

Session id: cron:clickhouse-impl-slot-6:20261030-130200

@groeneai

Copy link
Copy Markdown
Collaborator Author

cc @egor-click, could you review this and add the can be tested label so CI runs? While the perf dashboard registers no master runs, the 600 s dashboard wait on master_head shards ignores the job's 7200 s timeout, so the longest shard (4/6) is killed before the own-report fallback from #125734 can judge it; this bounds the uploads, the wait and the confirmation rerun by the time the job has left.

@clickhouse-gh

clickhouse-gh Bot commented Oct 30, 2026 •

Copy link
Copy Markdown
Contributor

Workflow [PR], commit [a2df91b]

Summary: ✅


AI Review

Summary

The PR limits master_head upload time, dashboard polling, and regression confirmation using the configured job timeout, reserving time to publish the result. No actionable findings at a2df91b547276e34690f97be4c718b0cc2ac9a82.

Final Verdict

Status: ✅ Approve

@clickhouse-gh clickhouse-gh Bot added pr-ci comp-ci-infrastructure CI/CD pipelines (GitHub Actions, CI scripts, runners). labels Oct 30, 2026
@egor-click egor-click added the can be tested Allows running workflows for external contributors label Oct 30, 2026
@egor-click

Copy link
Copy Markdown
Contributor

cc @egor-click, could you review this and add the can be tested label so CI runs? While the perf dashboard registers no master runs, the 600 s dashboard wait on master_head shards ignores the job's 7200 s timeout, so the longest shard (4/6) is killed before the own-report fallback from #125734 can judge it; this bounds the uploads, the wait and the confirmation rerun by the time the job has left.

added, there was a switch to the new cidb which caused temporary missing results but they are now there again and it should work as usual

@groeneai

Copy link
Copy Markdown
Collaborator Author

Thanks. Confirmed: the dashboard serves master runs again, and 4/6 passed on c759533 in 110 minutes without waiting. The change still matters for the next outage: 4/6's report ends about 108 minutes into its 120-minute timeout, so the full 600 s wait leaves about a minute (2d61726 made it with ~75 s to spare, five runs before it were killed). I updated the description; if you'd rather not keep it, I'll close it.

@alexey-milovidov alexey-milovidov self-assigned this Oct 30, 2026
@alexey-milovidov
alexey-milovidov added this pull request to the merge queue Oct 30, 2026
Merged via the queue into ClickHouse:master with commit a48a934 Oct 30, 2026
354 of 355 checks passed
@robot-ch-test-poll robot-ch-test-poll added the pr-synced-to-cloud The PR is synced to the cloud repo label Oct 30, 2026
huldarchen pushed a commit to huldarchen/ClickHouse that referenced this pull request Oct 30, 2026
On 2026-10-30 the performance dashboard backend was switched to a new
CIDB (explained by egor-click on ClickHouse#128236). For about 3 minutes
(14:09:54Z to 14:13:05Z, measured from the polls of 6 shards) it
answered HTTP 500 with ClickHouse code 60 for the tables it reads:

  failed to resolve performance comparison run: code: 60, message:
  Unknown table expression identifier 'perf_test_times_v1'
  failed to load performance comparison rows: code: 60, message:
  Unknown table expression identifier 'query_metrics_v2'

`dashboard_did_not_answer` knew no signature for this message, so the
500 was a `PerfDashboardError`; the poll loop keeps the first hard
error, and `main` failed the shard instead of judging it by its own
report. Four `Performance Comparison (arm_release, master_head, N/6)`
jobs whose 600 s wait ended inside the window failed this way
(ClickHouse#126879 6/6, ClickHouse#128209 1/6 and 3/6, ClickHouse#128097 2/6), all with 0 slower
queries. Shards whose wait outlived the window got the same requests
answered with 200 and passed.

The request cannot cause this answer: the table names are the
backend's own storage, and identical requests (same run id and test)
were served after the window. It is the case the class documents,
"the dashboard, or the CIDB tables it reads, did not answer", so add
the measured signature next to the two existing ones. Only a 5xx with
an application envelope is affected; a 4xx with this text, a non-JSON
body, and every other 5xx keep their classification, and a real hard
error seen before or after it still wins.

Validated locally against a fake dashboard serving the logged bodies:
the incident replay fails on master and reaches the own-report
fallback with the fix.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
opensource-fork-sync Bot pushed a commit to cla7aye15I4nd/opensource-ClickHouse__ClickHouse that referenced this pull request Nov 9, 2026
`upload_budget` gives the REPORT-stage uploads at least 60 s however late the
job is, but the dashboard gate was called with `min(upload_deadline, end)`.
When the benchmarks end late, the uploads start after `end`, so the gate's
deadline has already passed when it starts: it raises "it was spent before the
first request" without asking the dashboard, and the shard is judged by its
own report, which fails on any slower row. The 3 red jobs since 2026-11-04
(master 29da6da, PRs ClickHouse#128972 and ClickHouse#129010) had 25-40 s of the uploads'
60 s left, and the dashboard answers in about 2 s with no blocking row for any
of them.

The gate now gets `upload_deadline`. That equals `min(upload_deadline, end)`
whenever at least 60 s remain before `end` at the start of the uploads, so
only a late job changes. Since the gate can now run past `end`, a dashboard
GET no longer starts after the gate's deadline, and its socket timeout is
`min(60, remaining)` instead of a flat 60 s. Otherwise a request started just
before the deadline could wait 3 x 60 s past it in a late job. The gate's
waits now end by the same bound as the uploads' 60 s floor.

Related: ClickHouse#128236
Co-Authored-By: Claude Opus 5.5 <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

can be tested Allows running workflows for external contributors comp-ci-infrastructure CI/CD pipelines (GitHub Actions, CI scripts, runners). pr-ci pr-synced-to-cloud The PR is synced to the cloud repo

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants