Skip to content

Retry the LogCluster readiness probe inside the INSERT retry loop - #113592

Open
alexey-milovidov wants to merge 3 commits into
masterfrom
logcluster-retry-readiness-probe
Open

Retry the LogCluster readiness probe inside the INSERT retry loop#113592
alexey-milovidov wants to merge 3 commits into
masterfrom
logcluster-retry-readiness-probe

Conversation

@alexey-milovidov

Copy link
Copy Markdown
Member

LogCluster.do_query — the build-profile telemetry INSERT transport — probed is_ready once, before its retry loop. That probe is a SELECT 1 against the same writer endpoint as the INSERT itself, so it fails during exactly the minutes-long memory-pressure spikes (Code 241 for every query) that the retries added in #113409 exist to ride out. A single transient failure of the probe abandoned the upload before any POST was attempted, and build_profile_hook.py (correctly) failed the build job closed — defeating the mitigation.

select in the same file already retries its readiness probe inside its own backoff loop, with a comment documenting this exact reason. This moves do_query's probe into its retry loop on the same growing backoff, and reports the never-became-ready case explicitly so the caller's fail-close assert is not the only thing in the log.

A regression test in ci/tests/test_build_profile_hook.py drives the probe as [False, False, True] and asserts the INSERT still runs.

Found by clickhouse-gh review on #113409 after it merged.

Related: #113409
Related: #113408

Changelog category (leave one):

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

`LogCluster.do_query` probed `is_ready` once, before its retry loop. That
probe is a `SELECT 1` against the same writer endpoint as the INSERT, so
it fails during exactly the memory-pressure spikes (Code 241 for every
query) that the retries added in #113409 exist to ride out: a single
transient failure of the probe abandoned the upload before any `POST`
was attempted, and `build_profile_hook.py` failed the build job closed.

Move the probe into the retry loop, on the same growing backoff `select`
already uses for it, and report the never-became-ready case explicitly so
the fail-close assert is not the only thing in the log.

Follow-up to #113409
Related: #113408
@clickhouse-gh

clickhouse-gh Bot commented Aug 6, 2026

Copy link
Copy Markdown
Contributor

Workflow [PR], commit [a81a86b]

Summary:


AI Review

Summary

This PR fixes LogCluster.do_query so the readiness probe is retried on the same backoff as the INSERT, and it now distinguishes "never became ready" from "every POST raised" in its terminal diagnostics. I reviewed the current diff, the full changed files, the existing inline thread and reply, and the current PR discussion/CI state, and I did not find any remaining correctness, reliability, or coverage issues in the latest code.

Final Verdict
  • Status: ✅ Approve

@clickhouse-gh clickhouse-gh Bot added the pr-ci label Aug 6, 2026
Comment thread ci/jobs/scripts/log_cluster.py
When `is_ready` succeeds but every `_session.post` raises (timeout,
connection reset, ...), `response` stays `None` and the terminal
diagnostic printed `ERROR: LogCluster not ready`, pointing the incident
at the wrong subsystem. Track whether a `POST` was ever attempted and
print the never-became-ready message only when the loop never got past
`is_ready`; otherwise report that every `POST` attempt failed with an
exception (the tracebacks are already in the log).

Adds regression tests for both terminal paths in
`ci/tests/test_build_profile_hook.py`.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant