Repository navigation
CI: bound the queries to the CI Logs cluster in the log-export setup by wall clock - #126217
alexey-milovidov merged 2 commits into
Conversation
…by wall clock The CI Logs cluster probe in `setup_log_cluster.sh` passes `--connect_timeout 3 --receive_timeout=45` and is meant to fail fast, but it blocked Performance Comparison jobs for up to 3646 s on 2026-10-16 (39 jobs on master and nine PRs timed out at 7200 s). When `receive_timeout` fires, the client cancels the query and then waits for the server to acknowledge the cancel with no limit (`ClientBase::receiveResult` checks the timeout only while not cancelled). An overloaded cluster keeps the query in its `max_concurrent_queries` queue without reading the socket, so the probe ended only when the server answered (`TOO_MANY_SIMULTANEOUS_QUERIES` after 122-1067 s) or the remote end dropped the connection (`ATTEMPT_TO_READ_AFTER_EOF` at 45 + 3600 s). The per-table remote `CREATE TABLE IF NOT EXISTS` has the same unbounded wait. Run both queries to the cluster through a `remote_client` helper that wraps `clickhouse-client` in `timeout --kill-after 10 90`. A timed-out `CREATE` stops the table loop, since the next table would wait another 90 s. 90 s is twice the client's own `receive_timeout` (so a fast server-side error still wins) and matches the Python port of this probe in ClickHouse#116031. The export stays best-effort; callers only check whether the script succeeded. Validated locally with a server that holds the probe in its query queue: the unchanged script blocks 120 s / 240 s for a 120 s / 240 s queue wait, the new one stops at 90 s; a hung `CREATE` now costs 90 s once; the healthy setup and teardown, the transient-error retry and the credential masking are unchanged. Co-Authored-By: Claude Opus 5.5 <[email protected]>
Pass the CI Logs password to the client through `CLICKHOUSE_PASSWORD`, so that it is not in the command line of `timeout`, which does not wipe it like the client does. Detect the expiry of `timeout` by the elapsed time, since the client's exit code can have the same low byte. Co-Authored-By: Claude Opus 5.5 <[email protected]>
Internal second-model review (rounds r0 on d59e8a0, r1 on 2c482fa): 2 issues fixed, 2 nits noted
Re-review of r1: no new findings. |
Pre-PR validation gate (click to expand)
Session id: cron:clickhouse-impl-slot-6:20261016-053300 |
|
Workflow [PR], commit [2c482fa] Summary: ✅
AI ReviewSummaryThe PR bounds both CI Logs cluster setup queries with a 90-second wall-clock timeout and a 10-second kill grace, passes credentials through the environment, and stops further table exports after a timed-out Final VerdictStatus: ✅ Approve |
|
cc @maxknv, could you review this and add |
973247c
Related: #110173
Changelog category (leave one):
Changelog entry (a user-readable short description of the changes that goes into CHANGELOG.md):
...
Description
On 2026-10-16 between 01:40 and 02:21 UTC, 39
Performance Comparisonjobs on master and nine PRs endederrorwithJob timed out ... timeout [7200], e.g. arm 1/6 on #125985 and amd 4/6 on master. The hour was lost before the first perf query: the CI Logs cluster probe insetup_log_cluster.shblocked for up to 3646 s despite--connect_timeout 3 --receive_timeout=45.receive_timeoutdoes not bound a query. When it fires, the client cancels the query and then waits for the server to acknowledge the cancel with no time limit. The overloaded cluster (Too many simultaneous queries ... Current: 1033, maximum: 1000) does not read the cancel while the query is queued, so the probe ended only when the server answered (Code: 202after 122-1067 s) or the remote end dropped the connection (ATTEMPT_TO_READ_AFTER_EOFat 45 + 3600 s).Change: a
remote_clienthelper runsclickhouse-clientundertimeout --kill-after 10 90, for both queries to the cluster: the probe and the per-tableCREATE TABLE IF NOT EXISTS. A timed-outCREATEstops the table loop instead of costing another 90 s per table. The password goes throughCLICKHOUSE_PASSWORDinstead of the command line oftimeout. 90 s is twice the client'sreceive_timeoutand the bound the Python port of this probe in #116031 uses; a healthy probe takes about 2 s. The export stays best-effort and the callers treat the exit code as before.Validation, locally, with a server that holds the probe in its query queue: before the change the probe took 120 s and 240 s for a 120 s and a 240 s queue wait, after it 90 s. A hung
CREATEcosts 90 s once, and the healthy setup and teardown create and drop the same tables as before.Workflow [PR]
Sync PR [sync-upstream/pr/126217]
Version info
26.11.1.104-master(included in26.11and later)