mirror of
https://github.com/ClickHouse/ClickHouse.git
synced 2024-11-22 15:42:02 +00:00
ZooKeeper: Better connection loop [#CLICKHOUSE-2]
This commit is contained in:
parent
5a525605be
commit
e4fe1ef4b3
@ -560,6 +560,7 @@ void ZooKeeper::connect(
|
||||
{
|
||||
try
|
||||
{
|
||||
socket = Poco::Net::StreamSocket(); /// Reset the state of previous attempt.
|
||||
socket.connect(address, connection_timeout);
|
||||
|
||||
socket.setReceiveTimeout(operation_timeout);
|
||||
@ -577,7 +578,7 @@ void ZooKeeper::connect(
|
||||
}
|
||||
catch (const Poco::Net::NetException & e)
|
||||
{
|
||||
fail_reasons << "\n" << getCurrentExceptionMessage(false);
|
||||
fail_reasons << "\n" << getCurrentExceptionMessage(false) << ", " << address.toString();
|
||||
}
|
||||
catch (const Poco::TimeoutException & e)
|
||||
{
|
||||
@ -603,7 +604,7 @@ void ZooKeeper::connect(
|
||||
out << address.toString();
|
||||
}
|
||||
|
||||
out << fail_reasons.str();
|
||||
out << fail_reasons.str() << "\n";
|
||||
throw Exception(out.str(), ZCONNECTIONLOSS);
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user