clickhouse-keeper: correctly handle closed client connection

This will avoid noisy message like:

    DB::Exception: Cannot read all data. Bytes read: 0. Bytes expected: 4.

Signed-off-by: Azat Khuzhin <a.khuzhin@semrush.com>
This commit is contained in:
Azat Khuzhin 2022-03-30 20:27:31 +03:00
parent b388bb8448
commit 9820230e95

View File

@ -415,6 +415,12 @@ void KeeperTCPHandler::runImpl()
log_long_operation("Polling socket");
if (result.has_requests && !close_received)
{
if (in->eof())
{
LOG_DEBUG(log, "Client closed connection, session id #{}", session_id);
break;
}
auto [received_op, received_xid] = receiveRequest();
packageReceived();
log_long_operation("Receiving request");