Skip to content

Commit

Permalink
Fix 'connect_timeout' and 'connect_retries' for 'MYSQL_COM_BINLOG_DUMP'
Browse files Browse the repository at this point in the history
Fix honoring of 'connect_timeout_server_max' and
'connect_retries_on_failure' for 'fast_forward' sessions created by
'MYSQL_COM_BINLOG_DUMP' when session still doesn't own a backend
connection.
  • Loading branch information
JavierJF committed Jan 27, 2023
1 parent b1b3fc4 commit 982272a
Showing 1 changed file with 13 additions and 0 deletions.
13 changes: 13 additions & 0 deletions lib/MySQL_Session.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -4014,6 +4014,19 @@ int MySQL_Session::get_pkts_from_client(bool& wrong_pass, PtrSize_t& pkt) {
mybe->server_myds->reinit_queues(); // reinitialize the queues in the myds . By default, they are not active
mybe->server_myds->wait_until = 0;
if (mybe->server_myds->DSS==STATE_NOT_INITIALIZED) {
// NOTE: This section is entirely borrowed from 'STATE_SLEEP' for 'session_fast_forward'.
// Check comments there for extra information.
// =============================================================================
if (mybe->server_myds->max_connect_time == 0) {
uint64_t connect_timeout =
mysql_thread___connect_timeout_server < mysql_thread___connect_timeout_server_max ?
mysql_thread___connect_timeout_server_max : mysql_thread___connect_timeout_server;
mybe->server_myds->max_connect_time = thread->curtime + connect_timeout * 1000;
}
mybe->server_myds->connect_retries_on_failure = mysql_thread___connect_retries_on_failure;
CurrentQuery.start_time=thread->curtime;
// =============================================================================

// we don't have a connection
previous_status.push(FAST_FORWARD); // next status will be FAST_FORWARD
set_status(CONNECTING_SERVER); // now we need a connection
Expand Down

0 comments on commit 982272a

Please sign in to comment.