Repository navigation
Bound each system-table dump with a timeout in Collect logs - #109837
alexey-milovidov merged 2 commits into
Conversation
The Collect logs phase of stateless jobs dumps ~12 system tables one by one with clickhouse local. On amd_tsan + s3 runs the JSON-typed system.minio_audit_logs table can grow huge and clickhouse local can hang reading it. Because the dump command had no per-command timeout, a single stuck table consumed the rest of the job's 9000s budget; the job watchdog then SIGKILLed everything and the job finished with a job-level ERROR (exit code 125 / -15) and results:[] with no individual test failing. Wrap each dump in coreutils timeout so one stuck table is bounded (600s) and reported as a failed dump instead of exhausting the whole job budget. Co-Authored-By: Claude Opus 4.8 <[email protected]>
Pre-PR validation gate (click to expand)
Session id: cron:clickhouse-worker-slot-6:20260708-194100 |
|
Workflow [PR], commit [efaecca] Summary: ✅ AI ReviewSummaryThis PR wraps each Findings
Final Verdict
|
…bles timeout returns 124 only when the child dies on the initial SIGTERM. A dump that ignores SIGTERM is escalated with SIGKILL after --kill-after and exits 128+9 = 137, which previously fell through without the "timed out after ..." annotation. Classify both 124 and 137 as timeouts via a shared _annotate_timeout helper and apply it to all three dump branches (replica 0/1/2), which the replica 1/2 branches previously lacked entirely. Add a TERM-ignoring regression case (trap "" TERM) that exercises the --kill-after escalation path and asserts the 137 exit code, run through the default shell in the same `cd ... && timeout ...` shape as production so the 137 code is surfaced rather than a raw SIGKILL. Co-Authored-By: Claude Opus 4.8 <[email protected]>
|
Addressed in efaecca:
Verified locally with coreutils 9.4: |
azat
left a comment
There was a problem hiding this comment.
AFAICS the problem is minio logs - https://s3.amazonaws.com/clickhouse-test-reports/json.html?PR=107307&sha=2817cfac2ebe798bb14a65fd758886c7048be8c5&name_0=PR&name_1=Stateless%20tests%20%28amd_tsan%2C%20s3%20storage%2C%20parallel%2C%202%2F2%29
But why minio_audit_logs is so heavy? I think this will only hide the problem
Shouldn't we collapsed it instead?
Also why not use clickhouse builtin limit, i.e. "max_execution_time".
|
Answers inline. Why Collapse vs timeout - agreed, the timeout only bounds the symptom. The volume is genuine S3 traffic, so the durable fix is to reduce what we dump, not just cap it. Options I can do as a follow-up:
Which shape do you prefer? I will send the collapse PR once you pick. The timeout stays as a backstop for the wedged case below regardless. Why not For the spurious |
A bounded 600s timeout on system.minio_audit_logs / minio_server_logs is minio's own webhook-fed operational-log volume on s3 runs, not a ClickHouse bug. ClickHouse#109837 bounded the dump so a stuck table no longer eats the 9000s job budget, but it surfaced the bounded timeout as a FAIL, reddening otherwise-green PRs. Keep the detail visible in the report but only turn the check FAIL on a genuine failure (a real system table, a non-timeout minio error, too-many-rows, or any replica dump failure). Co-Authored-By: Claude Opus 4.8 <[email protected]>
…-tables-timeout Bound each system-table dump with a timeout in Collect logs
A bounded 600s timeout on system.minio_audit_logs / minio_server_logs is minio's own webhook-fed operational-log volume on s3 runs, not a ClickHouse bug. ClickHouse#109837 bounded the dump so a stuck table no longer eats the 9000s job budget, but it surfaced the bounded timeout as a FAIL, reddening otherwise-green PRs. Keep the detail visible in the report but only turn the check FAIL on a genuine failure (a real system table, a non-timeout minio error, too-many-rows, or any replica dump failure). Co-Authored-By: Claude Opus 4.8 <[email protected]>
Changelog category (leave one):
Changelog entry (a user-readable short description of the changes that goes into CHANGELOG.md):
Description
The "Collect logs" phase of stateless jobs dumps ~12 system tables one by one with
clickhouse local ... select * from system.<table> into outfile .... On amd_tsan + s3 runs the JSON-typedsystem.minio_audit_logstable can grow very large andclickhouse localcan hang reading it. The dump command had no per-command timeout, so a single stuck table consumed the rest of the job's 9000s budget. The job watchdog then SIGKILLed everything and the job finished with a job-level ERROR (exit code 125 / -15) andresults: []- no individual test failed.This is the "genuine 9000s timeout" variant of
Stateless tests (amd_tsan, s3 storage, parallel, 2/2)failures (distinct from the praktika watchdog exit-125 hang fixed by #109096). Signature in all three sampled failures: all tests pass (~6000s), thendump_system_tablesdumps 10 tables fine and hangs on the 11th (minio_audit_logs) until the 9000s watchdog fires.Sample failures (all end with the timeout firing during the
minio_audit_logsdump):Fix: wrap each dump in coreutils
timeout --signal=TERM --kill-after=60 600so one stuck table is bounded and reported as a failed dump (info on the "Scraping system tables" result) instead of exhausting the whole job budget.timeoutreturns 124 on expiry, handled by the existingres != 0branch with a clear "timed out after Ns" message. Applied to all three replica dump call sites.Added
ci/tests/test_dump_system_tables_timeout.pycovering both directions of the timeout wrapper and guarding that the production code keeps building the timeout prefix.Version info
26.7.1.762(included in26.7and later)