Skip to content

Fix stress test failures due to internal queries was fuzzed - #114127

Merged
azat merged 1 commit into
ClickHouse:masterfrom
azat:ci/fix-stress
Aug 10, 2026
Merged

azat merged 1 commit into
ClickHouse:masterfrom
azat:ci/fix-stress

Conversation

@azat

@azat azat commented Aug 10, 2026 •

Copy link
Copy Markdown
Member

Error was for:

[2026-08-10 05:00:51] Error on processing query: Timeout exceeded while receiving data from server. Waited for 15 seconds, timeout is 15 seconds.
[2026-08-10 05:00:51] (query: SELECT value FROM system.server_settings WHERE name = 'cannot_allocate_thread_fault_injection_probability')

This was due to fuzzing:

2026.08.10 07:00:35.127593 [ 4326 ] {9b3ad88a-ce22-4a34-b550-00862eab7c14} <Debug> executeQuery: (from [::1]:41902) (query 1, line 1) SELECT value FROM system.server_settings WHERE name = 'cannot_allocate_thread_fault_injection_probability' (stage: Complete)
2026.08.10 07:00:35.128096 [ 4326 ] {9b3ad88a-ce22-4a34-b550-00862eab7c14} <Test> CancellationChecker: Added to set. query: SELECT value FROM system.server_settings WHERE name = 'cannot_allocate_thread_fault_injection_probability', timeout: 60000 milliseconds
2026.08.10 07:00:35.148318 [ 4326 ] {9b3ad88a-ce22-4a34-b550-00862eab7c14} <Trace> Planner: Query to stage Complete
2026.08.10 07:00:35.148967 [ 4326 ] {9b3ad88a-ce22-4a34-b550-00862eab7c14} <Trace> Planner: Query from stage FetchColumns to stage Complete
2026.08.10 07:00:35.203023 [ 4326 ] {9b3ad88a-ce22-4a34-b550-00862eab7c14} <Test> QueryMetricLog: Scheduling next collecting task for query_id 9b3ad88a-ce22-4a34-b550-00862eab7c14 in 924 ms
2026.08.10 07:00:35.227141 [ 4326 ] {9b3ad88a-ce22-4a34-b550-00862eab7c14} <Debug> executeQuery: Read 439 rows, 131.73 KiB in 0.095 sec., 4617.504 rows/sec., 1.35 MiB/sec.
2026.08.10 07:00:35.229612 [ 4326 ] {9b3ad88a-ce22-4a34-b550-00862eab7c14} <Test> ProcessorProfileLog: Processors profile log:
2026.08.10 07:00:35.231128 [ 4326 ] {9b3ad88a-ce22-4a34-b550-00862eab7c14} <Trace> ASTFuzzer: Fuzzed query: SELECT value FROM system.server_settings WHERE equals(name)
2026.08.10 07:00:35.285188 [ 4326 ] {9b3ad88a-ce22-4a34-b550-00862eab7c14} <Trace> ASTFuzzer: Fuzzed query failed: Code: 42. DB::Exception: Number of arguments for function equals doesn't match: passed 1, should be 2: In scope SELECT value FROM system.server_settings WHERE equals(name). (NUMBER_OF_ARGUMENTS_DOESNT_MATCH) (version 26.8.1.1)
2026.08.10 07:00:35.289274 [ 4326 ] {9b3ad88a-ce22-4a34-b550-00862eab7c14} <Trace> ASTFuzzer: Fuzzed query: SELECT DISTINCT value FROM system.server_settings WHERE name = 'cannot_allocate_thread_fault_injection_probability'
2026.08.10 07:00:35.371717 [ 4326 ] {9b3ad88a-ce22-4a34-b550-00862eab7c14} <Debug> MemoryTracker: Query peak memory usage: 307.00 KiB.
2026.08.10 07:00:35.374006 [ 4326 ] {9b3ad88a-ce22-4a34-b550-00862eab7c14} <Trace> ASTFuzzer: Fuzzed query: SELECT DISTINCT value FROM system.server_settings WHERE name = 'cannot_allocate_thread_fault_injection_probability'
2026.08.10 07:00:35.459150 [ 4326 ] {9b3ad88a-ce22-4a34-b550-00862eab7c14} <Debug> MemoryTracker: Query peak memory usage: 307.00 KiB.
2026.08.10 07:00:35.460910 [ 4326 ] {9b3ad88a-ce22-4a34-b550-00862eab7c14} <Trace> ASTFuzzer: Fuzzed query: SELECT DISTINCT value FROM merge('system', '.+') WHERE name = 'cannot_allocate_thread_fault_injection_probability'
2026.08.10 07:00:51.858493 [ 4326 ] {9b3ad88a-ce22-4a34-b550-00862eab7c14} <Debug> MemoryTracker: Query peak memory usage: 57.48 MiB.
2026.08.10 07:00:51.860026 [ 4326 ] {9b3ad88a-ce22-4a34-b550-00862eab7c14} <Trace> ASTFuzzer: Fuzzed query failed: Code: 139. DB::Exception: The `catboost_lib_path` setting is not configured, so clickhouse-library-bridge cannot be started: it is the only path the bridge is allowed to load shared libraries from. (NO_ELEMENTS_IN_CONFIG) (version 26.8.1.1)
2026.08.10 07:00:51.883782 [ 4326 ] {9b3ad88a-ce22-4a34-b550-00862eab7c14} <Trace> ASTFuzzer: Fuzzed query: SELECT DISTINCT value FROM system.server_settings WHERE equals('cannot_allocate_thread_fault_injection_probability', name, 'cannot_allocate_thread_fault_injection_probability')
2026.08.10 07:00:51.933465 [ 4326 ] {9b3ad88a-ce22-4a34-b550-00862eab7c14} <Trace> ASTFuzzer: Fuzzed query failed: Code: 42. DB::Exception: Number of arguments for function equals doesn't match: passed 3, should be 2: In scope SELECT DISTINCT value FROM system.server_settings WHERE equals('cannot_allocate_thread_fault_injection_probability', name, 'cannot_allocate_thread_fault_injection_probability'). (NUMBER_OF_ARGUMENTS_DOESNT_MATCH) (version 26.8.1.1)
2026.08.10 07:00:51.933712 [ 4326 ] {9b3ad88a-ce22-4a34-b550-00862eab7c14} <Debug> MemoryTracker: Query peak memory usage: 315.20 KiB.
2026.08.10 07:00:51.934314 [ 4326 ] {9b3ad88a-ce22-4a34-b550-00862eab7c14} <Debug> TCPHandler: Processed in 16.809 sec.
2026.08.10 07:00:51.935510 [ 4326 ] {9b3ad88a-ce22-4a34-b550-00862eab7c14} <Test> CancellationChecker: Removing query 9b3ad88a-ce22-4a34-b550-00862eab7c14 from done tasks

CI: https://s3.amazonaws.com/clickhouse-test-reports/json.html?PR=113927&sha=d73c7aab26cf62033a605876eb031669791a1958&name_0=PR&name_1=Stress%20test%20%28arm_release%29

Changelog category (leave one):

  • Not for changelog (changelog entry is not required)

Version info

  • Merged into: 26.8.1.1091 (included in 26.8 and later)

Error was for:

    [2026-08-10 05:00:51] Error on processing query: Timeout exceeded while receiving data from server. Waited for 15 seconds, timeout is 15 seconds.
    [2026-08-10 05:00:51] (query: SELECT value FROM system.server_settings WHERE name = 'cannot_allocate_thread_fault_injection_probability')

This was due to fuzzing:

    2026.08.10 07:00:35.127593 [ 4326 ] {9b3ad88a-ce22-4a34-b550-00862eab7c14} <Debug> executeQuery: (from [::1]:41902) (query 1, line 1) SELECT value FROM system.server_settings WHERE name = 'cannot_allocate_thread_fault_injection_probability' (stage: Complete)
    2026.08.10 07:00:35.128096 [ 4326 ] {9b3ad88a-ce22-4a34-b550-00862eab7c14} <Test> CancellationChecker: Added to set. query: SELECT value FROM system.server_settings WHERE name = 'cannot_allocate_thread_fault_injection_probability', timeout: 60000 milliseconds
    2026.08.10 07:00:35.148318 [ 4326 ] {9b3ad88a-ce22-4a34-b550-00862eab7c14} <Trace> Planner: Query to stage Complete
    2026.08.10 07:00:35.148967 [ 4326 ] {9b3ad88a-ce22-4a34-b550-00862eab7c14} <Trace> Planner: Query from stage FetchColumns to stage Complete
    2026.08.10 07:00:35.203023 [ 4326 ] {9b3ad88a-ce22-4a34-b550-00862eab7c14} <Test> QueryMetricLog: Scheduling next collecting task for query_id 9b3ad88a-ce22-4a34-b550-00862eab7c14 in 924 ms
    2026.08.10 07:00:35.227141 [ 4326 ] {9b3ad88a-ce22-4a34-b550-00862eab7c14} <Debug> executeQuery: Read 439 rows, 131.73 KiB in 0.095 sec., 4617.504 rows/sec., 1.35 MiB/sec.
    2026.08.10 07:00:35.229612 [ 4326 ] {9b3ad88a-ce22-4a34-b550-00862eab7c14} <Test> ProcessorProfileLog: Processors profile log:
    2026.08.10 07:00:35.231128 [ 4326 ] {9b3ad88a-ce22-4a34-b550-00862eab7c14} <Trace> ASTFuzzer: Fuzzed query: SELECT value FROM system.server_settings WHERE equals(name)
    2026.08.10 07:00:35.285188 [ 4326 ] {9b3ad88a-ce22-4a34-b550-00862eab7c14} <Trace> ASTFuzzer: Fuzzed query failed: Code: 42. DB::Exception: Number of arguments for function equals doesn't match: passed 1, should be 2: In scope SELECT value FROM system.server_settings WHERE equals(name). (NUMBER_OF_ARGUMENTS_DOESNT_MATCH) (version 26.8.1.1)
    2026.08.10 07:00:35.289274 [ 4326 ] {9b3ad88a-ce22-4a34-b550-00862eab7c14} <Trace> ASTFuzzer: Fuzzed query: SELECT DISTINCT value FROM system.server_settings WHERE name = 'cannot_allocate_thread_fault_injection_probability'
    2026.08.10 07:00:35.371717 [ 4326 ] {9b3ad88a-ce22-4a34-b550-00862eab7c14} <Debug> MemoryTracker: Query peak memory usage: 307.00 KiB.
    2026.08.10 07:00:35.374006 [ 4326 ] {9b3ad88a-ce22-4a34-b550-00862eab7c14} <Trace> ASTFuzzer: Fuzzed query: SELECT DISTINCT value FROM system.server_settings WHERE name = 'cannot_allocate_thread_fault_injection_probability'
    2026.08.10 07:00:35.459150 [ 4326 ] {9b3ad88a-ce22-4a34-b550-00862eab7c14} <Debug> MemoryTracker: Query peak memory usage: 307.00 KiB.
    2026.08.10 07:00:35.460910 [ 4326 ] {9b3ad88a-ce22-4a34-b550-00862eab7c14} <Trace> ASTFuzzer: Fuzzed query: SELECT DISTINCT value FROM merge('system', '.+') WHERE name = 'cannot_allocate_thread_fault_injection_probability'
    2026.08.10 07:00:51.858493 [ 4326 ] {9b3ad88a-ce22-4a34-b550-00862eab7c14} <Debug> MemoryTracker: Query peak memory usage: 57.48 MiB.
    2026.08.10 07:00:51.860026 [ 4326 ] {9b3ad88a-ce22-4a34-b550-00862eab7c14} <Trace> ASTFuzzer: Fuzzed query failed: Code: 139. DB::Exception: The `catboost_lib_path` setting is not configured, so clickhouse-library-bridge cannot be started: it is the only path the bridge is allowed to load shared libraries from. (NO_ELEMENTS_IN_CONFIG) (version 26.8.1.1)
    2026.08.10 07:00:51.883782 [ 4326 ] {9b3ad88a-ce22-4a34-b550-00862eab7c14} <Trace> ASTFuzzer: Fuzzed query: SELECT DISTINCT value FROM system.server_settings WHERE equals('cannot_allocate_thread_fault_injection_probability', name, 'cannot_allocate_thread_fault_injection_probability')
    2026.08.10 07:00:51.933465 [ 4326 ] {9b3ad88a-ce22-4a34-b550-00862eab7c14} <Trace> ASTFuzzer: Fuzzed query failed: Code: 42. DB::Exception: Number of arguments for function equals doesn't match: passed 3, should be 2: In scope SELECT DISTINCT value FROM system.server_settings WHERE equals('cannot_allocate_thread_fault_injection_probability', name, 'cannot_allocate_thread_fault_injection_probability'). (NUMBER_OF_ARGUMENTS_DOESNT_MATCH) (version 26.8.1.1)
    2026.08.10 07:00:51.933712 [ 4326 ] {9b3ad88a-ce22-4a34-b550-00862eab7c14} <Debug> MemoryTracker: Query peak memory usage: 315.20 KiB.
    2026.08.10 07:00:51.934314 [ 4326 ] {9b3ad88a-ce22-4a34-b550-00862eab7c14} <Debug> TCPHandler: Processed in 16.809 sec.
    2026.08.10 07:00:51.935510 [ 4326 ] {9b3ad88a-ce22-4a34-b550-00862eab7c14} <Test> CancellationChecker: Removing query 9b3ad88a-ce22-4a34-b550-00862eab7c14 from done tasks

CI: https://s3.amazonaws.com/clickhouse-test-reports/json.html?PR=113927&sha=d73c7aab26cf62033a605876eb031669791a1958&name_0=PR&name_1=Stress%20test%20%28arm_release%29
@clickhouse-gh

clickhouse-gh Bot commented Aug 10, 2026 •

Copy link
Copy Markdown
Contributor

Workflow [PR], commit [6fe5a48]

Summary: ❌

job_name test_name status info comment
Stress test (amd_debug) FAIL
Hung check failed, possible deadlock found FAIL cidb

AI Review

Summary

This PR extends make_query_command in the stress harness to force ast_fuzzer_runs=0, so harness-owned clickhouse client maintenance queries no longer inherit the stress profile's server-side AST fuzzer setting. That matches the existing safeguard in tests/clickhouse-test for infrastructure queries, and I did not find a current correctness or reliability issue in the touched path.

Final Verdict

✅ No review findings.

@clickhouse-gh clickhouse-gh Bot added the pr-not-for-changelog This PR should not be mentioned in the changelog label Aug 10, 2026
@azat
azat enabled auto-merge August 10, 2026 09:24
@clickhouse-gh

clickhouse-gh Bot commented Aug 10, 2026

Copy link
Copy Markdown
Contributor

Build profile diff (arm_release)

Comparing 6fe5a48b7 with master 5e52a0f26 (stripped binary size, per-symbol sizes and ThinLTO time; object sizes against the warmup build of b9d4064cb; compile times per translation unit against the most recent warmup build that recompiled it).

✅ No significant changes.

Binary sizes
Binary Master PR Δ
programs/clickhouse-stripped 690.92 MiB 687.90 MiB -3.03 MiB (-0.44%)

Only the stripped binary is compared: the official master build keeps debug symbols while PR builds strip them, so the other binaries differ by construction.

Compile time of recompiled translation units

6 translation units recompiled, 4 s compile time in total, 6 of them have a recent master baseline.

Job report

@alesapin alesapin self-assigned this Aug 10, 2026
@azat

azat commented Aug 10, 2026

Copy link
Copy Markdown
Member Author

Stress test (amd_debug)

Some issues with prometheus storage likely, that leads to hung

But hard to debug, since the hung check output is truncated - #114143

@azat
azat added this pull request to the merge queue Aug 10, 2026
azat added a commit to azat/ClickHouse that referenced this pull request Aug 10, 2026
The full dumps (sql_stacktraces.log, c_stacktraces.log) land in the cwd
of clickhouse-test, which neither job uploads. Move them into the stress
output folder; attach as debug files in functional tests.

Refs: https://s3.amazonaws.com/clickhouse-test-reports/PRs/114127/6fe5a48b7b2a8285cb97fa3f081c07320d5d33ce/stress_test_amd_debug/hung_check.log
Related: ClickHouse#114127

Co-Authored-By: Claude Fable 5 <[email protected]>
Merged via the queue into ClickHouse:master with commit c807135 Aug 10, 2026
178 of 180 checks passed
@azat
azat deleted the ci/fix-stress branch August 10, 2026 12:09
@robot-ch-test-poll3 robot-ch-test-poll3 added the pr-synced-to-cloud The PR is synced to the cloud repo label Aug 10, 2026
azat added a commit to azat/ClickHouse that referenced this pull request Aug 11, 2026
The full dumps (sql_stacktraces.log, c_stacktraces.log) land in the cwd
of clickhouse-test, which neither job uploads. Move them into the stress
output folder; attach as debug files in functional tests.

Refs: https://s3.amazonaws.com/clickhouse-test-reports/PRs/114127/6fe5a48b7b2a8285cb97fa3f081c07320d5d33ce/stress_test_amd_debug/hung_check.log
Related: ClickHouse#114127

Co-Authored-By: Claude Fable 5 <[email protected]>
azat added a commit to azat/ClickHouse that referenced this pull request Aug 11, 2026
The full dumps (sql_stacktraces.log, c_stacktraces.log) land in the cwd
of clickhouse-test, which neither job uploads. Move them into the stress
output folder; attach as debug files in functional tests.

Refs: https://s3.amazonaws.com/clickhouse-test-reports/PRs/114127/6fe5a48b7b2a8285cb97fa3f081c07320d5d33ce/stress_test_amd_debug/hung_check.log
Related: ClickHouse#114127

Co-Authored-By: Claude Fable 5 <[email protected]>
azat added a commit to azat/ClickHouse that referenced this pull request Aug 11, 2026
The full dumps (sql_stacktraces.log, c_stacktraces.log) land in the cwd
of clickhouse-test, which neither job uploads. Move them into the stress
output folder; attach as debug files in functional tests.

Refs: https://s3.amazonaws.com/clickhouse-test-reports/PRs/114127/6fe5a48b7b2a8285cb97fa3f081c07320d5d33ce/stress_test_amd_debug/hung_check.log
Related: ClickHouse#114127

Co-Authored-By: Claude Fable 5 <[email protected]>
azat added a commit to azat/ClickHouse that referenced this pull request Aug 11, 2026
The full dumps (sql_stacktraces.log, c_stacktraces.log) land in the cwd
of clickhouse-test, which neither job uploads. Move them into the stress
output folder; attach as debug files in functional tests.

Refs: https://s3.amazonaws.com/clickhouse-test-reports/PRs/114127/6fe5a48b7b2a8285cb97fa3f081c07320d5d33ce/stress_test_amd_debug/hung_check.log
Related: ClickHouse#114127

Co-Authored-By: Claude Fable 5 <[email protected]>
azat added a commit to azat/ClickHouse that referenced this pull request Aug 11, 2026
…l tests

The full dumps (sql_stacktraces.log, c_stacktraces.log) land in the cwd
of clickhouse-test, which neither job uploads. Move them into the stress
output folder; attach as debug files in functional tests.

Refs: https://s3.amazonaws.com/clickhouse-test-reports/PRs/114127/6fe5a48b7b2a8285cb97fa3f081c07320d5d33ce/stress_test_amd_debug/hung_check.log
Related: ClickHouse#114127

Co-Authored-By: Claude Fable 5 <[email protected]>
pull Bot pushed a commit to erickirt/ClickHouse that referenced this pull request Sep 26, 2026
…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]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

pr-not-for-changelog This PR should not be mentioned in the changelog 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.

3 participants