Repository navigation
Do not abort run-fuzzer.sh when the fuzzer client exits before its PID is found - #129073
Conversation
…ID is read run-fuzzer.sh polls `ps -o pid= --ppid <timeout pid>` to find the clickhouse-client started by `timeout`, then read the PID a second time outside any condition. `ps` exits 1 when `timeout` has no child, and under `set -e` that failing command substitution killed the script before status.tsv was written, so the job reported `error` although the fuzzer found nothing. The runner restarts the client on exit 0 to use the whole time budget, so a targeted job over a tiny corpus (a single `SHOW PRIVILEGES`, which is the corpus of every PR that adds an access type) runs 20-160 passes, and without gdb attached a pass can end before a poll finds the client. Two shapes were seen in CI: the client exited before any poll found it (all 50 polls print `Not found`), or it exited between the poll that found it and the second read. Capture the PID in the polling condition, drop the second read, and skip the client gdb attach when no PID was found. `wait` on the timeout process still returns the client's real exit code, so the restart/stop logic is unchanged. Failing jobs: https://s3.amazonaws.com/clickhouse-test-reports/praktika.html?PR=129033&sha=848480638bef900cfb5b8109c68b330e693c734a&name_0=PR&name_1=AST%20fuzzer%20%28amd_debug%2C%20targeted%2C%20old_compatibility%29 https://s3.amazonaws.com/clickhouse-test-reports/praktika.html?PR=123854&sha=b6b8aa5f6f4159160d2ff95fb1799f10e7fbd20d&name_0=PR&name_1=AST%20fuzzer%20%28amd_debug%2C%20targeted%29 Co-Authored-By: Claude Opus 5.5 <[email protected]>
Internal second-model review: 0 findings openCold review and Gate B of head
|
Pre-PR validation gate (click to expand)
Session id: cron:clickhouse-impl-slot-6:20261103-172600 |
|
cc @maxknv, could you review this and add the |
|
Workflow [PR], commit [326f29d] Summary: ✅ AI ReviewSummaryThe PR prevents Missing context / blind spots
Final VerdictStatus: ✅ Approve. |
|
🕵️ @groeneai The fix is right. The second
Two small, optional points:
|
Review on ClickHouse#129073: print the PID found by the poll again (the second `ps` used to print it), and do not spend the whole 5 s poll on a pass whose client is already gone. bash reaps the background `timeout` as soon as it exits and keeps its status for `wait`, so `kill -0` on it fails from the next poll on (measured in the clickhouse/fuzzer image, bash 5.2.21: `ps -o stat= -p` is already empty, it is not a zombie). Such a pass now leaves the poll after at most one retry instead of 50, and `wait` still returns the client's exit code. Co-Authored-By: Claude Opus 5.5 <[email protected]>
|
Thanks, both are in 326f29d:
|
Related: #129033
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 reports
errorwhen a fuzzer pass finishes before the runner finds the client's PID.Description
Targeted AST fuzzer jobs report
errorwithFuzzer runner aborted before writing status.tsvalthough the fuzzer found nothing, e.g. #129033 and this job. 7 such jobs on 3 PRs since 2026-10-04, all adding an access type, so their corpus is the singleSHOW PRIVILEGESof01271_show_privileges.run-fuzzer.shrestarts the client on exit 0 until the budget is used, so such a job runs many passes (162 in one job). After polling for theclickhouse-clientthattimeoutstarts, the script read its PID a second time, outside any condition. If the client had already exited,psreturned 1 andset -ekilled the script beforestatus.tsvwas written. Without gdb attached, aSHOW PRIVILEGESpass takes 17 ms on the server, under one 0.1 s poll interval. In the CI logs, either all 50 polls printedNot found, or a poll found the client and the second read did not.Now the poll that finds the PID keeps and logs it, and the second read is removed. The client gdb attach is skipped only when no PID was found, and the poll stops once
timeoutitself has exited instead of polling for 5 s.waitstill returns the client's exit code, so restart and failure handling are unchanged.Validation: I ran the old and new pass block with stub
clickhouse-client,gdbandps. The old one aborts with the CI trace in three cases:psnever finds the client, finds it only once, or the client exits with code 3. The new one completes and keeps exit code 3. With the realpsand an instantly exiting client, the old block aborts 200/200 and the new one 0/200, and its pass block now takes under 0.5 s instead of 5 s. A client that runs 3 s, or thatpssees only after 10 polls, still gets gdb attached.Workflow [PR]
Sync PR [sync-upstream/pr/129073]
Version info
26.11.1.1336-master(included in26.11and later)