mirror of
https://github.com/ClickHouse/ClickHouse.git
synced 2024-11-21 15:12:02 +00:00
Merge 30c33aa1a7
into 44b4bd38b9
This commit is contained in:
commit
ecd378cc31
@ -151,7 +151,8 @@ void ConnectionEstablisherAsync::Task::run(AsyncCallback async_callback, Suspend
|
||||
{
|
||||
connection_establisher_async.reset();
|
||||
connection_establisher_async.connection_establisher.setAsyncCallback(async_callback);
|
||||
connection_establisher_async.connection_establisher.run(connection_establisher_async.result, connection_establisher_async.fail_message);
|
||||
connection_establisher_async.connection_establisher.run(connection_establisher_async.result,
|
||||
connection_establisher_async.fail_message, connection_establisher_async.force_connected);
|
||||
connection_establisher_async.is_finished = true;
|
||||
}
|
||||
|
||||
|
@ -76,6 +76,8 @@ public:
|
||||
|
||||
const std::string & getFailMessage() const { return fail_message; }
|
||||
|
||||
void resumeConnectionWithForceOption(bool force_connected_) {force_connected = force_connected_; resume();}
|
||||
|
||||
private:
|
||||
bool checkBeforeTaskResume() override;
|
||||
|
||||
@ -125,6 +127,7 @@ private:
|
||||
|
||||
bool is_finished = false;
|
||||
bool restarted = false;
|
||||
bool force_connected = false;
|
||||
};
|
||||
|
||||
#endif
|
||||
|
@ -281,7 +281,7 @@ int HedgedConnectionsFactory::getReadyFileDescriptor(bool blocking, AsyncCallbac
|
||||
|
||||
HedgedConnectionsFactory::State HedgedConnectionsFactory::resumeConnectionEstablisher(int index, Connection *& connection_out)
|
||||
{
|
||||
replicas[index].connection_establisher->resume();
|
||||
replicas[index].connection_establisher->resumeConnectionWithForceOption(/*force_connected_*/ shuffled_pools[index].error_count != 0);
|
||||
|
||||
if (replicas[index].connection_establisher->isCancelled())
|
||||
return State::CANNOT_CHOOSE;
|
||||
|
@ -80,6 +80,7 @@ def _check_exception(exception, expected_tries=3):
|
||||
for i, line in enumerate(lines[3 : 3 + expected_tries]):
|
||||
expected_lines = (
|
||||
"Code: 209. " + EXCEPTION_NETWORK + EXCEPTION_TIMEOUT,
|
||||
"Code: 209. " + EXCEPTION_NETWORK + "Timeout: connect timed out",
|
||||
EXCEPTION_CONNECT_TIMEOUT,
|
||||
EXCEPTION_TIMEOUT,
|
||||
)
|
||||
|
Loading…
Reference in New Issue
Block a user