Repository navigation
Do not render the client progress into a canceled terminal buffer - #127834
Conversation
When the terminal of the client embedded into the server (SSH, Web Terminal) is gone, a failed write cancels `tty_buf` and reports the error, but the client keeps receiving progress packets, and `ProgressIndication::writeProgress` then writes into the canceled buffer, which is a `LOGICAL_ERROR` (`Cannot write to canceled buffer`) from `ClientBase::receiveEndOfQueryForInsert`. Skip rendering the progress indication and the progress table into a canceled buffer. Found by the Stress test with randomized protocols: #125517 Co-Authored-By: Claude Opus 5.5 <[email protected]>
|
Workflow [PR], commit [167183a] Summary: ✅
AI ReviewSummaryThis PR prevents progress rendering and cleanup from writing into a canceled terminal buffer after an embedded client disconnects, and adds an Missing context / blind spots
Final VerdictStatus: ✅ Approve. No code changes requested. |
The write of the progress into the gone terminal fails and cancels the terminal buffer, then `processInsertQuery` cancels the query and `receiveEndOfQueryForInsert` keeps receiving the progress. Without the guards of the previous commit, the test reports `Cannot write to canceled buffer` (and aborts the server in debug builds); with them, it passes. Address review: #127834 Co-Authored-By: Claude Opus 5.5 <[email protected]>
…05453_webterminal_close_during_insert` The predicate also matched the `executeQuery` debug entries carrying the text of the checking query itself and of its parallel runs in the flaky check, so the expected zero became 3..32. https://s3.amazonaws.com/clickhouse-test-reports/praktika.html?PR=127834&sha=244ae25e5ce661b3a17225662a6f3679f2afca94&name_0=PR&name_1=Stateless%20tests%20%28arm_asan_ubsan%2C%20targeted%29 #127834 Co-Authored-By: Claude Opus 5.5 <[email protected]>
Build profile diff (arm_release)Comparing ✅ No significant changes. Binary sizes
The official master build is compiled with Compile time of recompiled translation units8 translation units recompiled, 10 s compile time in total, 8 of them have a recent master baseline. |
When the terminal of the client embedded into the server (SSH, Web Terminal) is gone, a failed write cancels
tty_bufand reports the error, but the client keeps receiving progress packets.ProgressIndication::writeProgressthen writes into the canceled buffer, which raises aLOGICAL_ERROR(Cannot write to canceled buffer), an abort in debug and sanitizer builds:This change skips rendering the progress indication and the progress table (
writeProgress,clearProgressOutput,writeTable,clearTableOutput) into a canceled buffer. All of them run undertty_mutex, so the check cannot race with the write that cancels the buffer.The Stress test (
amd_debug, SharedCatalog, meta in keeper) of the CH Inc sync of the PR that randomizes the protocols of the Stress test found it.Related: #125517
Related: #125973
Related: #126142
Changelog category (leave one):
Changelog entry (a user-readable short description of the changes that goes into CHANGELOG.md):
Fix a
LOGICAL_ERRORCannot write to canceled bufferin the server when the terminal of an SSH or Web Terminal session is closed while the embedded client shows the progress of a query.🤖 Generated with Claude Code
Workflow [PR]
Sync PR [sync-upstream/pr/127834]
Version info
26.11.1.904-master(included in26.11and later)