Skip to content

CI: classify a timed-out "Build profile diff" readiness probe as a CI logs cluster outage - #129675

Merged
fm4v merged 1 commit into
ClickHouse:masterfrom
groeneai:log-cluster-probe-read-timeout-unavailable
Nov 18, 2026
Merged

fm4v merged 1 commit into
ClickHouse:masterfrom
groeneai:log-cluster-probe-read-timeout-unavailable

Conversation

@groeneai

@groeneai groeneai commented Nov 6, 2026 •

Copy link
Copy Markdown
Collaborator

Related: #121048
Related: #128067
Related: #120462

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

Build profile diff reports a readiness probe that connected to the CI logs cluster and then timed out as a cluster outage (green, nothing compared) instead of failing the check.

Description

On 2026-11-06 between 00:00Z and 02:52Z, Build profile diff failed on 8 unrelated PRs, for example #129611 (job). Each log shows 8 readiness probes ending Read timed out. (read timeout=3), then LogClusterNotReady: the endpoint never became ready.

The read-only sub-service of the CI logs cluster stopped answering for 2 to 14 minute windows. LogCluster.is_ready turns a transport exception on its SELECT 1 into a bare False with no probe_error, so select raises LogClusterNotReady, which main does not catch. The same outage hitting a POST ends LogClusterUnavailable (#121048), as does a probe the server rejects with 241 (#128067).

Change: a probe that raises requests.exceptions.ReadTimeout now sets probe_error to LogClusterUnavailable, and the existing #128067 path reports the check green with CI logs cluster unavailable, nothing compared: the endpoint never became ready: the readiness probe timed out: ... in the result and the PR comment. As there, the last probe decides. This is the SELECT 1-timeout leg from #121048 (comment).

A ReadTimeout cannot be a wrong endpoint: with requests 2.33.0 (the CI pin) it is raised only after the name resolved and a server accepted the connection. Refused, unresolvable (no wildcard DNS in us-east-2.aws.clickhouse-staging.com), unreachable and certificate-mismatch hosts raise ConnectionError, and the server itself rejects a rotated password with 516. Those, a missing secret and a gateway answer stay red.

Validation: a throwaway harness compared master with this branch on 6 real-socket cases, 12 mocked-transport cases and main() end to end. Only the probe-timeout cases change.


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

Version info

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

… logs cluster outage

When the read-only sub-service of the CI logs cluster stops answering,
every `SELECT 1` readiness probe of `LogCluster.select` raises
`requests.exceptions.ReadTimeout`. `is_ready` turned that into a bare
False without a `probe_error`, so `select` raised `LogClusterNotReady`,
which `build_profile_diff_job.main` does not catch, and the check went
red on unrelated PRs (8 of them on 2026-11-06 between 00:00Z and 02:52Z,
e.g. job 127646247697 of ClickHouse#129611). The same outage hitting a POST already
ends `LogClusterUnavailable` (ClickHouse#121048), and so does a probe the server
rejects with 241 (ClickHouse#128067).

A probe that raises `ReadTimeout` now records `LogClusterUnavailable` in
`probe_error`, and the tail added by ClickHouse#128067 reports the read green as
"the endpoint never became ready: the readiness probe timed out: ...".
The last probe decides, as there.

A `ReadTimeout` (requests 2.33.0, the CI pin) is raised only after the
name resolved and a server accepted the connection: a stalled TLS
handshake or a stalled answer. Connection refused, an unresolvable name,
no SYN-ACK and a certificate mismatch raise `ConnectionError`
(`ConnectTimeout` and `SSLError` are subclasses), and the server itself
rejects a rotated password with 516. All of those, a missing secret and
a gateway answer still end `LogClusterNotReady`, as ruled on ClickHouse#120288.

This is the `SELECT 1`-timeout leg left open on ClickHouse#121048. Validated with
a throwaway harness against master (real sockets, mocked transport and
`main()` end to end); only the probe-timeout cases change. No test is
committed for the CI scripts (ClickHouse#119766).

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

groeneai commented Nov 6, 2026

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

Pre-publication review by an independent model (engine: codex; 0 findings) plus my own review (0 blockers, 0 majors). Two documentation-level nits were noted and not acted on: neither changes behaviour.

Session id: cron:clickhouse-review-slot-8:20261106-041700

@groeneai

groeneai commented Nov 6, 2026

Copy link
Copy Markdown
Collaborator Author
Pre-PR validation gate (click to expand)
# Question Answer
a Deterministic repro? Yes. A local listener that accepts TCP and never starts TLS, used as the LogCluster URL, reproduces the CI log on master every time: 8 probes Read timed out. (read timeout=3), then LogClusterNotReady: the endpoint never became ready. Through build_profile_diff_job.main() it reproduces the red check and the "Comparing commit ... failed" PR comment. 3/3 runs.
b Root cause explained? is_ready turns any transport exception on its SELECT 1 into a bare False without probe_error, so when every probe of a select times out, the tail raises LogClusterNotReady, which main does not catch. The same outage on a POST, or a probe the server rejects with 241, already ends LogClusterUnavailable (green).
c Fix matches root cause? Yes. The probe now records a ReadTimeout as LogClusterUnavailable in probe_error, where the exception class is known, and reuses the existing #128067 tail. No timeout, retry or budget change.
d Test intent preserved / new tests added? No committed test: CI script (no tests for test infrastructure, #119766). Validated with a throwaway harness of 19 cases.
e Both directions demonstrated? Yes. On master the stalled-TCP, stalled-TLS, every-probe-timeout, 516-then-timeout and end-to-end main() cases end LogClusterNotReady; with the fix they end LogClusterUnavailable / green. Asserting the fix expectations against master fails exactly those 5 cases.
f Fix is general across code paths? The POST path already classifies a timeout as an outage (#121048). The writer do_query does not read probe_error and is unchanged. CIDBCluster is a different class with its own probe, not touched.
g Fix generalizes across inputs (params/datatypes/wrappers)? Exception matrix: ReadTimeout on a stalled TCP or TLS answer goes green; connection refused, unresolvable name, ConnectTimeout, certificate mismatch, 516, headerless 502 and a missing secret stay red; 241 stays green; mixed sequences follow the last probe.
h Backward compatible? (maintainer-approved exception only) CI script only, no settings or formats. is_ready still returns a bool.
i Invariants and contracts preserved? probe_error is still reset at every is_ready entry, so the last probe decides, as defined by #128067. The tail order (answer, then POST attempted, then probe) is unchanged, and every non-timeout probe failure still ends LogClusterNotReady.

Session id: cron:clickhouse-impl-slot-5:20261106-040100

@groeneai

groeneai commented Nov 6, 2026

Copy link
Copy Markdown
Collaborator Author

cc @alexey-milovidov @leshikus, could you review this and add the can be tested label so CI runs? A readiness probe SELECT 1 that connects and then hits its 3 s read timeout now sets probe_error to LogClusterUnavailable, so the existing #128067 tail reports Build profile diff green instead of LogClusterNotReady (the SELECT 1-timeout follow-up from #121048); connect, DNS, TLS, 516 and missing-secret failures stay red.

@clickhouse-gh

clickhouse-gh Bot commented Nov 6, 2026 •

Copy link
Copy Markdown
Contributor

Workflow [PR], commit [e90fa64]

Summary: ✅


AI Review

Summary

The PR classifies a readiness-probe ReadTimeout as LogClusterUnavailable, allowing Build profile diff to complete green for this outage while retaining existing failure classifications for other probe errors. No actionable findings at commit e90fa64a01aad186640510838bc9cc61e8810c84. All 19 throwaway test methods passed with requests 2.33.0, covering the regression against the PR base, real HTTP/TLS stalls, probe-state transitions, upload failures, and job-result handling.

Final Verdict

Status: ✅ Approve.

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

clickhouse-gh Bot commented Nov 6, 2026

Copy link
Copy Markdown
Contributor

Build profile diff (arm_release)

Comparing e90fa64a0 with master b51445ef4 (stripped binary size, per-symbol sizes and ThinLTO time; object sizes against the warmup build of 831894676; compile times per translation unit against the most recent warmup build that recompiled it).

✅ No significant changes.

Binary sizes

programs/clickhouse-stripped: smaller than the master baseline by the known offset between the two builds, so the difference is not shown. A delta that differs from the offset by more than 50% of it is shown, in either direction.

The official master build is compiled with -g and a pull request build is not, and XRay counts debug instructions towards its instrumentation threshold, so master instruments thousands of functions more and its binary is ~0.4% larger no matter what the pull request does.

Compile time of recompiled translation units

6 translation units recompiled, 4 s compile time in total, 6 of them have a recent master baseline.

Job report

@fm4v
fm4v added this pull request to the merge queue Nov 18, 2026
Merged via the queue into ClickHouse:master with commit ef104dd Nov 18, 2026
548 of 550 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 Nov 18, 2026
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.

3 participants