Repository navigation
Make server-side AST fuzzer respect KILL, timeout and shutdown - #107640
Conversation
`executeASTFuzzerQueries` runs as a query finish callback, after the outer query's pipeline executor has stopped enforcing limits. Its fuzzing loop never consulted the outer query status, so it ignored a `KILL QUERY`, the outer `max_execution_time`, and server shutdown (which cancels all queries). The query then lingered in the processlist while spawning more fuzzed queries, which can trip the stress test hung check. Check `QueryStatus::checkTimeLimitSoft` at the top of each iteration. It returns false without throwing on a kill, on the outer query's time limit, and on shutdown (`ProcessList::killAllQueries` marks every query killed), so the loop stops promptly. Observed in the stress test hung check on an unrelated PR: https://s3.amazonaws.com/clickhouse-test-reports/PRs/107475/6271a231daa9d7adfda7f2c725b71ef672a3feb1/stress_test_arm_asan_ubsan_s3/hung_check.log Co-Authored-By: Claude Opus 4.8 (1M context) <[email protected]>
|
Workflow [PR], commit [465978d] Summary: ❌
AI ReviewSummaryThis PR makes Findings
Tests
Final VerdictStatus: Minimum required actions: fix or explicitly reject no- |
Some fuzzable queries (e.g. `SHOW PROCESSLIST`) are not inserted into the `ProcessList`, so the outer `QueryStatus` is null and the `checkTimeLimitSoft` guard is a no-op. Such a query with a large `ast_fuzzer_runs` could keep spawning fuzzed queries through server shutdown. Check the `IsServerShuttingDown` metric at the top of each iteration. It is set at the very start of shutdown, before queries are killed, and does not depend on the outer query having a process-list owner. Co-Authored-By: Claude Opus 4.8 (1M context) <[email protected]>
LLVM Coverage Report
Changed lines: Changed C/C++ lines covered by tests: 8/12 (66.67%) | Lost baseline coverage: none · Uncovered code |
The server-side AST fuzzer (
ast_fuzzer_runs) runs as a query finish callback, after the outer query's pipeline executor has stopped enforcing limits. The fuzzing loop never consulted the outer query status, so it ignored aKILL QUERY, the outermax_execution_time, and server shutdown (which cancels all running queries). The outer query then kept spawning fuzzed queries and lingered in the processlist, which can trigger a false-positive stress test hung check.Now
QueryStatus::checkTimeLimitSoftis checked at the top of each fuzzing iteration. It returns false without throwing on a kill, on the outer query's time limit, or on shutdown (ProcessList::killAllQueriesmarks every query killed), so the loop stops promptly.Observed in the stress test hung check of an unrelated PR (#107475):
https://s3.amazonaws.com/clickhouse-test-reports/PRs/107475/6271a231daa9d7adfda7f2c725b71ef672a3feb1/stress_test_arm_asan_ubsan_s3/hung_check.log
Changelog category (leave one):
Changelog entry (a user-readable short description of the changes that goes into CHANGELOG.md):
...