Repository navigation
Bound the AST fuzzer post-fuzz liveness probe and do not fuzz the harness's own queries - #122353
Merged
alexey-milovidov merged 1 commit intoSep 26, 2026
Conversation
…ness's own queries After a clean fuzz run (`Fuzzer exit code is 143`), the post-fuzz liveness probe `clickhouse-client --handshake_timeout_ms=30000 --receive_timeout=5 --query 'SELECT 1'` sometimes never returns. status.tsv is then never written, praktika kills the job at its 18000 s timeout before any artifact is uploaded, and the job reports a bare ERROR with no server log. Five such runs in 45 days: PR ClickHouse#112304 (2026-08-18), PR ClickHouse#98670 (2026-08-19), PR ClickHouse#115530 (2026-08-20), true master 9816d0a `AST fuzzer (amd_release, oracle)` (2026-09-24) and PR ClickHouse#119237 `AST fuzzer (amd_debug, targeted, old_compatibility)` (2026-09-25). Only the last one printed the `1`. Two harness defects make the probe unbounded. (a) The probe is itself fuzzed on the server. query-fuzzer-tweaks-users.xml sets ast_fuzzer_runs=5 and ast_fuzzer_any_query=true on the `default` profile, and no harness-owned client call opted out. The server runs the mutated copies in a query-finish callback, and TCPHandler calls io.onFinish() after sending the data and before EndOfStream, so a fuzzed follow-up that does not finish holds the reply open after the `1` was printed. The same pin was part of ClickHouse#113248, which was closed as already integrated, but its run-fuzzer.sh half never reached master. The stress harness (ClickHouse#114127), the log export (ClickHouse#117996) and tests/clickhouse-test already pin it. (b) --receive_timeout does not bound the probe either. On a receive timeout ClientBase::receiveResult only records TIMEOUT_EXCEEDED and cancels the query; from then on it polls the connection until the server sends a packet, with no bound. A server whose connection thread never gets back to the socket holds the probe forever, which is what the four runs that printed nothing show. Pin --ast_fuzzer_runs=0 on every harness-owned client call through one variable; the fuzzer's own client stays unpinned. Run the two post-fuzz probes (the restart liveness check and the probe loop) under `timeout --signal TERM --kill-after=10 60`. A probe killed by timeout (rc 124, or 137 after the kill) is counted like the client's own "Timeout exceeded while", so a server that stops answering reaches the existing "treating server as hung" verdict after 12 retries (about 14 minutes) and the job keeps its logs. 60 s covers the probe's own worst case (30 s handshake, 5 s receive timeout, the cancel round trip) with room for a slow sanitizer server. The fallback branch now prints the probe's exit code instead of the last grep's. The pre-fuzz probes are not wrapped: the check after attaching gdb waits for gdb to load debug info on purpose, and the server is fresh there. One server-side hang the fuzzer produces, a self-deadlock when one query builds two system.stack_trace sources, is fixed separately in ClickHouse#120216. Co-Authored-By: Claude Opus 5.5 <[email protected]>
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 cold review of the same head (2 nits, neither blocking).
Severity: ❌ blocker / Session id: cron:clickhouse-review-slot-9:20260925-233003 |
Contributor
|
Workflow [PR], commit [b62e74c] Summary: ✅ AI ReviewSummaryThis PR updates Missing context / blind spots
Final Verdict✅ No actionable inline findings in the current diff. |
github-merge-queue
Bot
removed this pull request from the merge queue due to no response for status checks
Sep 26, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Changelog category (leave one):
Changelog entry (a user-readable short description of the changes that goes into CHANGELOG.md):
The AST fuzzer job no longer fuzzes its own liveness probe and bounds it, so a server that stops answering gets the existing hung verdict with its logs instead of a 5-hour job timeout.
Description
After a clean fuzz run, the post-fuzz liveness probe
SELECT 1can wait forever. The job then times out at 18000 s and reports a bareERRORwith no server log. A PR run printed1and then nothing for 4h28m; a master run printed nothing for 4h27m. Five such runs in 45 days.Two causes, both in
run-fuzzer.sh:query-fuzzer-tweaks-users.xmlenables the server-side AST fuzzer fordefault, and the mutated copies run in the query-finish callback, beforeEndOfStream. The pin was part of Do not run the server-side AST fuzzer on the stress harness's own queries #113248, but that half never reached master.--receive_timeoutdoes not bound the probe: on timeout the client sends Cancel and then waits for the server with no limit (ClientBase::receiveResult).The change pins
--ast_fuzzer_runs=0on every harness-owned client call (not on the fuzzer's own client) and runs the two post-fuzz probes undertimeout --signal TERM --kill-after=10 60. A probe killed bytimeoutcounts like the client's own timeout, so a server that stops answering gets the existing "treating server as hung" verdict after 12 retries (12 to 14 minutes), with its logs. The pre-fuzz probes are unchanged: the server is fresh there, and the check after attaching gdb waits for it on purpose.Validation (throwaway scripts): an unpinned
SELECT 1got 25 fuzzed follow-ups over 5 probes, the pinned one 0. Against a server holding a query it never answers, the old probe was still waiting when killed at 90 s, and the new one returned at 60 s. A mock-client run of the loop hangs on the old text and reaches the hung verdict on the new one; every other outcome is unchanged.One server-side hang the fuzzer produces (reading
system.stack_tracetwice in one query) is addressed separately in #120216. This builds on #115915, which bounded the probe's handshake.Workflow [PR]
Sync PR [sync-upstream/pr/122353]
Version info
26.10.1.737-master(included in26.10and later)