mirror of
https://github.com/ClickHouse/ClickHouse.git
synced 2024-12-12 17:32:32 +00:00
Fix bug with buffered read
This commit is contained in:
parent
0b079cdeb8
commit
fc0bca1ff2
@ -89,6 +89,7 @@ struct SocketInterruptablePollWrapper
|
||||
#if defined(POCO_HAVE_FD_EPOLL)
|
||||
int rc;
|
||||
epoll_event evout[2];
|
||||
memset(evout, 0, sizeof(evout));
|
||||
do
|
||||
{
|
||||
Poco::Timestamp start;
|
||||
@ -283,6 +284,8 @@ void TestKeeperTCPHandler::runImpl()
|
||||
|
||||
auto state = poll_wrapper->poll(session_timeout);
|
||||
if (state & SocketInterruptablePollWrapper::HAS_REQUEST)
|
||||
{
|
||||
do
|
||||
{
|
||||
auto received_op = receiveRequest();
|
||||
if (received_op == Coordination::OpNum::Close)
|
||||
@ -292,8 +295,10 @@ void TestKeeperTCPHandler::runImpl()
|
||||
}
|
||||
else if (received_op == Coordination::OpNum::Heartbeat)
|
||||
{
|
||||
LOG_TRACE(log, "Received heartbeat for session #{}", session_id);
|
||||
session_stopwatch.restart();
|
||||
}
|
||||
} while (in->available());
|
||||
}
|
||||
|
||||
if (state & SocketInterruptablePollWrapper::HAS_RESPONSE)
|
||||
|
Loading…
Reference in New Issue
Block a user