mirror of
https://github.com/ClickHouse/ClickHouse.git
synced 2024-11-24 16:42:05 +00:00
Fix 01822_async_read_from_socket_crash for hedged connection.
This commit is contained in:
parent
2d42b1ebf6
commit
0d549c197f
@ -353,6 +353,11 @@ bool HedgedConnections::resumePacketReceiver(const HedgedConnections::ReplicaLoc
|
|||||||
if (offset_states[location.offset].active_connection_count == 0 && !offset_states[location.offset].next_replica_in_process)
|
if (offset_states[location.offset].active_connection_count == 0 && !offset_states[location.offset].next_replica_in_process)
|
||||||
throw NetException("Receive timeout expired", ErrorCodes::SOCKET_TIMEOUT);
|
throw NetException("Receive timeout expired", ErrorCodes::SOCKET_TIMEOUT);
|
||||||
}
|
}
|
||||||
|
else if (std::holds_alternative<std::exception_ptr>(res))
|
||||||
|
{
|
||||||
|
finishProcessReplica(replica_state, true);
|
||||||
|
std::rethrow_exception(std::move(std::get<std::exception_ptr>(res)));
|
||||||
|
}
|
||||||
|
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
@ -31,7 +31,7 @@ public:
|
|||||||
}
|
}
|
||||||
|
|
||||||
/// Resume packet receiving.
|
/// Resume packet receiving.
|
||||||
std::variant<int, Packet, Poco::Timespan> resume()
|
std::variant<int, Packet, Poco::Timespan, std::exception_ptr> resume()
|
||||||
{
|
{
|
||||||
/// If there is no pending data, check receive timeout.
|
/// If there is no pending data, check receive timeout.
|
||||||
if (!connection->hasReadPendingData() && !checkReceiveTimeout())
|
if (!connection->hasReadPendingData() && !checkReceiveTimeout())
|
||||||
@ -43,7 +43,7 @@ public:
|
|||||||
/// Resume fiber.
|
/// Resume fiber.
|
||||||
fiber = std::move(fiber).resume();
|
fiber = std::move(fiber).resume();
|
||||||
if (exception)
|
if (exception)
|
||||||
std::rethrow_exception(std::move(exception));
|
return std::move(exception);
|
||||||
|
|
||||||
if (is_read_in_process)
|
if (is_read_in_process)
|
||||||
return epoll.getFileDescriptor();
|
return epoll.getFileDescriptor();
|
||||||
|
Loading…
Reference in New Issue
Block a user