Skip to content

Increase disks app interactive test command timeout - #107262

Closed
groeneai wants to merge 1 commit into
ClickHouse:masterfrom
groeneai:fix-disks-app-interactive-timeout
Closed

groeneai wants to merge 1 commit into
ClickHouse:masterfrom
groeneai:fix-disks-app-interactive-timeout

Conversation

@groeneai

Copy link
Copy Markdown
Collaborator

Changelog category (leave one):

  • CI Fix or Improvement (changelog entry is not required)

Changelog entry (a user-readable short description of the changes that goes into CHANGELOG.md):

...

Description

Separate fix requested by @ alexey-milovidov so it can merge sooner than #106650.

test_disks_app_interactive drives clickhouse disks --test-mode as a subprocess and waits up to 5s (poller.poll) for each command's output. Under sanitizer builds (MSAN, roughly 3-5x slower) at high host parallelism the subprocess can be CPU-starved past that 5s wall-clock deadline before it emits its first byte, raising a spurious TimeoutError: Disks client returned no output on trivial cleanup commands such as rm. The disks operations themselves are correct and fast.

This raises the default deadline to 60s. poll() returns as soon as output is ready, so a larger deadline never delays a fast response; the 900s pytest-timeout remains the real hang guard.

Observed amd_msan only, with 0 master failures in the last 14 days (CIDB). This is the residual failure mode left after #106730 (which made the assertions sort-order-independent); it is unrelated to the ipnsort/driftsort sort change in #106650.

test_disks_app_interactive drives `clickhouse disks --test-mode` as a subprocess and waits up to 5s (poller.poll) for each command's output. Under sanitizer builds (MSAN, roughly 3-5x slower) at high host parallelism the subprocess can be CPU-starved past that 5s wall-clock deadline before it emits its first byte, raising a spurious "Disks client returned no output" TimeoutError on trivial cleanup commands such as rm. The disks operations themselves are correct and fast.

Raise the default deadline to 60s. poll() returns as soon as output is ready, so a larger deadline never delays a fast response; the 900s pytest-timeout remains the real hang guard. Observed MSAN-only with 0 master failures.

Co-Authored-By: Claude Opus 4.8 <[email protected]>
@groeneai

Copy link
Copy Markdown
Collaborator Author

Pre-PR validation gate

# Question Answer
a Deterministic repro? Yes. .scratch/repro_timeout.py runs the exact execute_query poll/SEPARATOR/TimeoutError logic against a stub subprocess whose first output is delayed 6s (modeling MSAN + host-contention scheduling starvation). With the old 5.0s deadline it raises TimeoutError: Disks client returned no output (byte-for-byte the CI failure at test.py:93); with the new 60.0s deadline it returns the response.
b Root cause explained? The harness drives clickhouse disks --test-mode as a subprocess and waits poller.poll(timeout=5.0) for each command's first output. Under the MSAN build (~3-5x slower) at 6-way host parallelism the subprocess is CPU-starved past the 5s wall-clock deadline before emitting its first byte, so poll() returns empty and a spurious TimeoutError is raised on trivial cleanup commands (rm). The disks operation itself is correct and fast.
c Fix matches root cause? Yes. The root cause is the I/O deadline being too tight for the slowest sanitizer config; the fix raises that deadline (5s -> 60s). poll() returns the instant output is ready, so a larger deadline cannot delay or alter a fast response; it only stops a starved-but-correct run from being killed prematurely.
d Test intent preserved / new tests added? Preserved. No functional assertion changed; only the subprocess-response deadline. The 900s pytest-timeout remains the real hang guard, so a genuine hang is still caught. A regression test is N/A (this is a CI test-harness timing fix, not a product code bug).
e Both directions demonstrated? Yes, via the repro harness: FAILS (TimeoutError) at 5.0s, PASSES at 60.0s, using the identical poll logic. A real debug-build run passes under either deadline because the MSAN/contention starvation cannot be reproduced on a single-tenant box, so the harness is the correct demonstration for a pure-Python-deadline change.
f Fix is general, not a narrow patch? Yes. The change is on execute_query's default, which every DisksClient helper (rm/ls/mkdir/copy/move/read/write/...) routes through, so all commands get the relaxed deadline, not just the two cleanup calls CI happened to catch. No caller passes an explicit timeout, so there is no sibling path left at 5s.

CIDB: amd_msan only, 0 master failures in 14 days. This is the residual failure mode after #106730 (sort-order robustness); unrelated to the ipnsort/driftsort change in #106650.

Session id: cron:clickhouse-worker-slot-3:20260611-174300

@nikitamikhaylov nikitamikhaylov added the can be tested Allows running workflows for external contributors label Jun 11, 2026
@clickhouse-gh

clickhouse-gh Bot commented Jun 11, 2026 •

Copy link
Copy Markdown
Contributor

Workflow [PR], commit [7b03ad8]

Summary: ❌

job_name test_name status info comment
Stateless tests (amd_llvm_coverage, ParallelReplicas, s3 storage, parallel) FAIL
04322_106474_session_timezone_lowcardinality_datetime_csv_roundtrip FAIL cidb
03707_statistics_cache NOT_FAILED cidb
02345_implicit_transaction NOT_FAILED cidb

AI Review

Summary

This PR raises DisksClient.execute_query's default epoll.poll deadline from 5s to 60s for test_disks_app_interactive, so sanitizer or contended CI workers do not fail before the clickhouse disks --test-mode subprocess emits its first output. The change is limited to the test harness, all command helpers use this default, and a successful command still returns immediately when output is ready. I found no blocking issues.

Final Verdict

Status: ✅ Approve

@clickhouse-gh clickhouse-gh Bot added the pr-ci label Jun 11, 2026
@clickhouse-gh

clickhouse-gh Bot commented Jun 11, 2026

Copy link
Copy Markdown
Contributor

LLVM Coverage Report

Metric Baseline Current Δ
Lines 84.70% 84.60% -0.10%
Functions 92.40% 92.40% +0.00%
Branches 77.30% 77.30% +0.00%

Changed lines: No C/C++ source files changed — skipping uncovered code analysis.

Newly covered by added/modified tests: 273 line(s), 16 function(s) across 94 file(s) · Details

Top files
  • src/Backups/BackupEntriesCollector.cpp: 24 line(s), 2 function(s)
  • src/Storages/StorageReplicatedMergeTree.cpp: 20 line(s), 2 function(s)
  • src/Processors/QueryPlan/Optimizations/optimizeReadInOrder.cpp: 18 line(s)
  • src/Storages/ObjectStorageQueue/ObjectStorageQueueSource.cpp: 9 line(s)
  • src/Storages/MergeTree/MergeTreePartsMover.cpp: 8 line(s)

Full report

@groeneai

Copy link
Copy Markdown
Collaborator Author

CI finished on 7b03ad8. One non-passing functional check, not PR-caused:

No PR-caused failures. Ready for review.

(cron:our-pr-ci-monitor:20260611-213000)

@groeneai

Copy link
Copy Markdown
Collaborator Author

Closing as redundant. master already carries this exact change: execute_query default timeout is 60.0s (with a SEPARATOR-based poll loop) after #106650 merged 2026-06-18. The merge conflict here is our 5.0s->60.0s line colliding with that same line, so no diff remains. test_disks_app_interactive is 105 OK / 0 FAIL on master since the merge.

@groeneai groeneai closed this Jun 19, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

can be tested Allows running workflows for external contributors pr-ci

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants