Commit 1aa7ce7
Check
When waiting for a new query between requests, `TCPHandler::runImpl`
calls `in->eof()` at line 495 to detect client disconnection. If the
`ReadBuffer` was previously canceled (e.g., due to a failed read during
a prior query's callback), calling `eof()` triggers `next()`, which hits
`chassert(!isCanceled())` and aborts the server.
Add an `in->isCanceled()` check before `in->eof()` in the condition,
matching the pattern already used in `receivePacketsExpectCancel`. Also
guard the `in->eof()` call in the `LOG_TEST` message to avoid
evaluating it on a canceled buffer (function arguments are not
short-circuit evaluated unlike `||`).
https://s3.amazonaws.com/clickhouse-test-reports/json.html?PR=99537&sha=7338429ff8d3349ba147f9ba05558bbd6b84e4b2&name_0=PR&name_1=Stress%20test%20%28amd_tsan%29
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>isCanceled before calling eof on the input ReadBuffer in TCPHandler
1 parent 49a554c commit 1aa7ce7
1 file changed
Lines changed: 4 additions & 2 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
492 | 492 | | |
493 | 493 | | |
494 | 494 | | |
495 | | - | |
| 495 | + | |
496 | 496 | | |
497 | | - | |
| 497 | + | |
| 498 | + | |
| 499 | + | |
498 | 500 | | |
499 | 501 | | |
500 | 502 | | |
| |||
0 commit comments