Compare commits

...

3 Commits

Author SHA1 Message Date
lizhuoyu5
97e099811b
Merge 30c33aa1a7 into 334b28f6db 2024-11-19 17:50:53 -08:00
lzydmxy
30c33aa1a7 Fix test_distributed_respect_user_timeouts expected 2024-11-12 10:18:37 +08:00
lzydmxy
838408ff0a Force_connected for retry resume connection establisher 2024-10-31 16:09:25 +08:00
4 changed files with 7 additions and 2 deletions

View File

@ -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;
}

View File

@ -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

View File

@ -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;

View File

@ -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,
)