Repository navigation
Hold the query slot with a connected client in test_read_temporary_tables_on_failure - #129151
Conversation
…bles_on_failure The test filled the user's only max_concurrent_queries_for_user slot with a long sleepEachRow query and killed its client after 5 s, relying on the orphaned query to keep running so that the next SELECT 1 fails with TOO_MANY_SIMULTANEOUS_QUERIES before its external tables are read. Since ClickHouse#127149 the server cancels a query whose TCP client is gone, and sleep stops at its next 1 s chunk, so the slot is free before SELECT 1 arrives. Sanitizer builds lose that race every time (master red in amd_tsan, amd_msan and amd_asan_ubsan integration tests), arm_binary usually wins it. Hold the slot with a background request whose client stays connected, wait until it is in system.processes, run the unchanged SELECT 1, then stop the holder with KILL QUERY ... SYNC. The log assertions that are the purpose of the test are unchanged. 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; 0 findings) plus my own cold review (1 nit).
Severity: ❌ blocker / Session id: cron:clickhouse-review-slot-8:20261104-013600 |
Pre-PR validation gate (click to expand)
Session id: cron:clickhouse-impl-slot-41:20261104-011300 |
|
cc @CheSema, could you review this and add the |
|
Workflow [PR], commit [dd4ac12] Summary: ✅ AI ReviewSummaryThis PR keeps the concurrency slot occupied by a connected background client in Missing context / blind spots
Final VerdictStatus: ✅ Approve |
5f014d8
Related: #127149
Changelog category (leave one):
Changelog entry (a user-readable short description of the changes that goes into CHANGELOG.md):
...
Description
test_read_temporary_tables_on_failure/test.py::test_different_versionsfails on every master commit since #127149 inIntegration tests (amd_tsan / amd_msan / amd_asan_ubsan, db disk, 7/8)withFailed: DID NOT RAISE <class 'helpers.client.QueryRuntimeException'>(report).The test fills the user's only
max_concurrent_queries_for_userslot with a longsleepEachRowquery and then kills its client after 5 s, expecting the query to keep running. Since #127149 the server cancels a query whose client is gone, andsleepstops within a second, so the slot is free beforeSELECT 1arrives.arm_binaryusually wins that race (green on the same commits), and it is the only flavour that ran this test in #127149's own CI.Now the slot is held by a background request whose client stays connected. The test waits until it appears in
system.processes, runs the unchangedSELECT 1withmax_concurrent_queries_for_user = 1, then stops the holder withKILL QUERY ... SYNC. TheSELECT 1leg and the three log assertions (the server must skip the unread temporary-tables packet afterTOO_MANY_SIMULTANEOUS_QUERIES) are unchanged, and nothing depends on timing anymore.Validation (local debug build): the old test with a 3 s pause before
SELECT 1fails 3/3 on current master and passes 3/3 on a build before #127149. The new test passes 50/50 in 5 sessions with randomized settings, 3/3 with a 5 s pause, and 5/5 on an ASan build before #127149. WithskipDataremoved fromTCPHandler::runImplit fails onUnexpected packet.Workflow [PR]
Sync PR [sync-upstream/pr/129151]
Version info
26.11.1.1324-master(included in26.11and later)