mirror of
https://github.com/ClickHouse/ClickHouse.git
synced 2024-12-05 22:12:21 +00:00
5d3e3113b2
Right now it is possible to get this error CANNOT_READ_ALL_DATA if timings will goes wrong. The problem is that finalize() firstly calls shutdown() on the socket, this will trigger poll(POLLIN) (EOF) and the receiveThread() will trigger a receiveEvent which will fail because read will return 0 (while reading length). Note, that rearrange the code in the finalize (i.e. call shutdown() after) since the client sends CLOSE_XID before, and the server may close the connection already, and this will also trigger poll(POLLIN) (EOF), and read will return 0 also. So checking for the requests_queue.isFinished() is not enough, finalization_started should be checked instead. Easy reproducer: $ yes /keeper/api_version | head -n10000 | xargs -P30 -i clickhouse-keeper-client -q 'get {}' > /dev/null Signed-off-by: Azat Khuzhin <a.khuzhin@semrush.com>
0 lines
Plaintext
0 lines
Plaintext