Skip to content

Fix false-positive hung check failure caused by server-side AST fuzzer - #100472

Merged
Algunenano merged 2 commits into
ClickHouse:masterfrom
Algunenano:fix-stress-test-hung-check-fuzzer
Mar 24, 2026
Merged

Algunenano merged 2 commits into
ClickHouse:masterfrom
Algunenano:fix-stress-test-hung-check-fuzzer

Conversation

@Algunenano

@Algunenano Algunenano commented Mar 23, 2026 •

Copy link
Copy Markdown
Member

The stress test profile sets ast_fuzzer_runs=5 in the server config, enabling server-side AST fuzzing for all queries. When the hung check runs its SELECT count() FROM system.processes query via HTTP, the fuzzer mutates it and spawns additional queries that themselves appear in the processlist — creating a self-referential loop where the hung check always sees > 0 queries. After 90 seconds of polling, it attempts get_processlist_with_stacktraces (a heavy JOIN with symbolization, also fuzzed), which times out. By then the original queries have finished, but exit_code=1 is already set.

Two fixes:

  1. Add ast_fuzzer_runs=0 to the default HTTP params in clickhouse_execute_http, so all infrastructure queries (hung check, log analysis) are not fuzzed.
  2. When get_processlist_with_stacktraces times out, re-check get_processlist_size — if queries have finished during the timeout, don't treat it as a failure.

References: #100439
Closes #100445

Changelog category:

  • CI Fix or Improvement

Changelog entry:

...

Documentation entry for user-facing changes

  • Documentation is written (mandatory for new features)

Version info

  • Merged into: 26.4.1.181

The stress test profile sets `ast_fuzzer_runs=5`, enabling server-side
AST fuzzing for all queries. When the hung check runs its
`SELECT count() FROM system.processes` query via HTTP, the fuzzer
mutates it and spawns additional queries that appear in the processlist
— creating a self-referential loop where the hung check always sees
> 0 queries.

Two fixes:
1. Add `ast_fuzzer_runs=0` to the default HTTP params in
   `clickhouse_execute_http`, so infrastructure queries are not fuzzed.
2. When `get_processlist_with_stacktraces` times out, re-check
   `get_processlist_size` — if queries finished, don't fail.

References: ClickHouse#100439

Co-Authored-By: Claude Opus 4.6 (1M context) <[email protected]>
@clickhouse-gh

clickhouse-gh Bot commented Mar 23, 2026 •

Copy link
Copy Markdown
Contributor

Workflow [PR], commit [8a1d6ac]

Summary: ❌

job_name test_name status info comment
Build (amd_debug) error IGNORED
Build (amd_asan_ubsan) error IGNORED
Build (amd_tsan) error IGNORED
Build (amd_msan) error IGNORED
Build (arm_asan_ubsan) error IGNORED
Build (arm_binary) error IGNORED
Build (llvm_coverage_build) error IGNORED
Stateless tests (arm_asan_ubsan, targeted) error IGNORED
Stateless tests (amd_asan_ubsan, distributed plan, parallel, 1/2) error IGNORED
Stateless tests (amd_asan_ubsan, distributed plan, parallel, 2/2) error IGNORED

AI Review

Summary

This PR updates tests/clickhouse-test to avoid false-positive hung-query failures in stress runs by forcing ast_fuzzer_runs=0 for infrastructure HTTP queries and by re-checking system.processes when stacktrace collection times out. I did not find correctness, safety, or performance regressions in the changed logic, and the prior contradictory success-path issue reported by clickhouse-gh[bot] is addressed.

ClickHouse Rules

Item Status Notes
Deletion logging ➖
Serialization versioning ➖
Core-area scrutiny ✅
No test removal ✅
Experimental gate ➖
No magic constants ✅
Backward compatibility ✅
SettingsChangesHistory.cpp ➖
PR metadata quality ✅
Safe rollout ✅
Compilation time ✅

Final Verdict

  • Status: ✅ Approve

Comment thread tests/clickhouse-test Resolved

@PedroTadim PedroTadim left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM!

@Algunenano
Algunenano added this pull request to the merge queue Mar 24, 2026
Merged via the queue into ClickHouse:master with commit 27b1c08 Mar 24, 2026
147 of 148 checks passed
@Algunenano
Algunenano deleted the fix-stress-test-hung-check-fuzzer branch March 24, 2026 09:19
@robot-clickhouse robot-clickhouse added the pr-synced-to-cloud The PR is synced to the cloud repo label Mar 24, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

pr-ci pr-synced-to-cloud The PR is synced to the cloud repo

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Hung check failed, possible deadlock found

3 participants