Repository navigation
Conversation
`LocalConnection::sendQuery` attaches the client thread to the query, so an exception on that thread in the middle of the exchange (for example, a memory limit or an injected memory fault while the client handles a packet) escapes as a client exception instead of an `Exception` packet. `ClientBase::runInteractive` then resynchronizes the connection with `checkConnected`. For a TCP `Connection` that is a ping, which fails on a desynchronized exchange, and the reconnection drops the query on the server. For `LocalConnection` it returned `true` and kept the abandoned query state, whose `BlockIO` owns the process list entry, until the next query of the session or its end. In the web terminal and the SSH interface the failed query therefore stayed in `system.processes` while the session was idle at the prompt and counted toward `max_concurrent_queries_for_user`; in the Stress test such a query was listed for 1207 s and failed the hung check (PR ClickHouse#118372, `Stress test (amd_debug)`). `checkConnected` now ends the abandoned query, as `sendQuery` already does at the next query: cancel it if it is still running and reset the state. Its only caller is `ClientBase::resynchronizeConnectionAfterError`, which runs outside the try block of `runInteractive`, so the cancellation is guarded as in `~LocalConnection`: the executors' `cancel` rethrows the failure of a pipeline that failed while the client was not waiting for it, and letting it escape ended the session. The server-side failure path (an `Exception` packet) is handled separately in ClickHouse#127913. The test uses a new test-only fail point `local_connection_receive_packet_throw` that throws on the client thread at the first packet of a query. Co-Authored-By: Claude Opus 5.5 <[email protected]>
Internal second-model review: adjudication log (click to expand)Pre-publication review by an independent model (engine: codex; 1 finding; 1 full pass, no fix round needed).
Severity: ❌ blocker / Session id: cron:clickhouse-review-slot-8:20261030-083700 |
Pre-PR validation gate (click to expand)
Session id: cron:clickhouse-impl-slot-5:20261030-064900 |
|
cc @azat @Algunenano, could you review this and add the |
|
Workflow [PR], commit [4a3a5f8] Summary: ❌
AI ReviewSummaryPR #128209 makes Missing context / blind spots
Final VerdictStatus: ✅ Approve. No code changes requested. |
Build profile diff (arm_release)Comparing ✅ No significant changes. Binary sizes
The official master build is compiled with Compile time of recompiled translation units23 translation units recompiled, 149 s compile time in total, 23 of them have a recent master baseline. Median compile-time ratio to the baselines is ×1.05 (machine-speed difference or a change affecting every TU); per-TU deltas below are relative to that ratio. |
Keep it next to the related 05386_webterminal_close_during_query test, as asked in review. Co-Authored-By: Claude Opus 5.5 <[email protected]>
CI finish ledger - 4a3a5f8Every failure below has an owner: a fixing PR (mine or external), or a full-effort fix task
Session id: cron:our-pr-ci-monitor:20261030-150005 |
|
Fixing PR for the Performance Comparison (arm_release, master_head, 1/6 and 3/6) dashboard HTTP 500 failures: #128255 |
On 2026-10-30 the performance dashboard backend was switched to a new CIDB (explained by egor-click on ClickHouse#128236). For about 3 minutes (14:09:54Z to 14:13:05Z, measured from the polls of 6 shards) it answered HTTP 500 with ClickHouse code 60 for the tables it reads: failed to resolve performance comparison run: code: 60, message: Unknown table expression identifier 'perf_test_times_v1' failed to load performance comparison rows: code: 60, message: Unknown table expression identifier 'query_metrics_v2' `dashboard_did_not_answer` knew no signature for this message, so the 500 was a `PerfDashboardError`; the poll loop keeps the first hard error, and `main` failed the shard instead of judging it by its own report. Four `Performance Comparison (arm_release, master_head, N/6)` jobs whose 600 s wait ended inside the window failed this way (ClickHouse#126879 6/6, ClickHouse#128209 1/6 and 3/6, ClickHouse#128097 2/6), all with 0 slower queries. Shards whose wait outlived the window got the same requests answered with 200 and passed. The request cannot cause this answer: the table names are the backend's own storage, and identical requests (same run id and test) were served after the window. It is the case the class documents, "the dashboard, or the CIDB tables it reads, did not answer", so add the measured signature next to the two existing ones. Only a 5xx with an application envelope is affected; a 4xx with this text, a non-JSON body, and every other 5xx keep their classification, and a real hard error seen before or after it still wins. Validated locally against a fake dashboard serving the logged bodies: the incident replay fails on master and reaches the own-report fallback with the fix. Co-Authored-By: Claude Opus 5.5 <[email protected]>
Related: #118372
Related: #127913
Changelog category (leave one):
Changelog entry (a user-readable short description of the changes that goes into CHANGELOG.md):
Fixed a query of a web terminal or SSH session staying in
system.processesafter it failed on the client side of the session (for example, withMEMORY_LIMIT_EXCEEDEDwhile the result was being received), until the next query of the session. Such a query counted towardmax_concurrent_queries_for_user.Description
On 26.9.25.15,
SELECT number, toString(number) FROM numbers(1000000) SETTINGS max_memory_usage = '5M'in a web terminal session can fail on the client side (2 of 18 fresh sessions); the failed query then stays insystem.processeswhile the session is idle, and a query of the same user from another session withmax_concurrent_queries_for_user = 1is rejected withTOO_MANY_SIMULTANEOUS_QUERIES.Provenance: Stress test (amd_debug) on #118372,
Hung check failed: a web terminal query was listed for 1207 s.Root cause:
LocalConnectionattaches the client thread to the query, so an exception on that thread mid-exchange escapes as a client exception.ClientBasethen resynchronizes withcheckConnected: for TCP a ping that drops the desynchronized exchange, forLocalConnectiona plainreturn true, which kept the abandoned query's state (itsBlockIOowns the process list entry) until the next query or the end of the session.Change:
LocalConnection::checkConnectedends the abandoned query, assendQueryalready does at the next query; like~LocalConnectionit ignores an exception from the cancellation (the abandoned pipeline's own failure), so it never throws. #127913 covers the other path (a query that fails on the server side and delivers anExceptionpacket).Validation: the new test
05386_webterminal_client_error_leaves_processlist(test-only fail pointlocal_connection_receive_packet_throw) prints1without the fix and0with it (10/10 each, 50/50 randomized). With CI'smemory_tracker_fault_probability = 0.05, 96 of 108 injected faults left the query listed before the fix, 0 of 101 after. Web terminal, SSH andclickhouse-localtests: no new failures.Workflow [PR]
Sync PR [sync-upstream/pr/128209]