{{ message }}
Make server-side AST fuzzer respect KILL, timeout and shutdown#107640
Merged
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) <noreply@anthropic.com>
Contributor
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) <noreply@anthropic.com>
Contributor
LLVM Coverage ReportChanged lines: Changed C/C++ lines covered by tests: 8/12 (66.67%) | Lost baseline coverage: none · Uncovered code |
This was referenced Jun 22, 2026
1 task
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.

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