Commit 076bdd6c authored by unknown's avatar unknown

Another try to fix slave timeouts

parent 2547e933
...@@ -112,6 +112,8 @@ static my_bool is_NT(void) ...@@ -112,6 +112,8 @@ static my_bool is_NT(void)
} }
#endif #endif
extern ulong slave_net_timeout;
/* /*
** Create a named pipe connection ** Create a named pipe connection
*/ */
...@@ -203,6 +205,7 @@ mc_mysql_init(MYSQL *mysql) ...@@ -203,6 +205,7 @@ mc_mysql_init(MYSQL *mysql)
#ifdef __WIN__ #ifdef __WIN__
mysql->options.connect_timeout=20; mysql->options.connect_timeout=20;
#endif #endif
mysql->net.timeout = slave_net_timeout;
return mysql; return mysql;
} }
...@@ -655,7 +658,7 @@ mc_mysql_connect(MYSQL *mysql,const char *host, const char *user, ...@@ -655,7 +658,7 @@ mc_mysql_connect(MYSQL *mysql,const char *host, const char *user,
goto error; goto error;
} }
vio_keepalive(net->vio,TRUE); vio_keepalive(net->vio,TRUE);
net->timeout=slave_net_timeout;
/* Get version info */ /* Get version info */
mysql->protocol_version= PROTOCOL_VERSION; /* Assume this */ mysql->protocol_version= PROTOCOL_VERSION; /* Assume this */
if ((pkt_length=mc_net_safe_read(mysql)) == packet_error) if ((pkt_length=mc_net_safe_read(mysql)) == packet_error)
......
...@@ -456,7 +456,7 @@ int fetch_nx_table(THD* thd, MASTER_INFO* mi) ...@@ -456,7 +456,7 @@ int fetch_nx_table(THD* thd, MASTER_INFO* mi)
nx_errno = ER_BAD_HOST_ERROR; nx_errno = ER_BAD_HOST_ERROR;
goto err; goto err;
} }
mysql->net.timeout=slave_net_timeout;
safe_connect(thd, mysql, mi); safe_connect(thd, mysql, mi);
if (slave_killed(thd)) if (slave_killed(thd))
goto err; goto err;
...@@ -1312,7 +1312,7 @@ pthread_handler_decl(handle_slave,arg __attribute__((unused))) ...@@ -1312,7 +1312,7 @@ pthread_handler_decl(handle_slave,arg __attribute__((unused)))
goto err; goto err;
} }
mysql->net.timeout=slave_net_timeout;
thd->proc_info = "connecting to master"; thd->proc_info = "connecting to master";
#ifndef DBUG_OFF #ifndef DBUG_OFF
sql_print_error("Slave thread initialized"); sql_print_error("Slave thread initialized");
...@@ -1331,7 +1331,8 @@ pthread_handler_decl(handle_slave,arg __attribute__((unused))) ...@@ -1331,7 +1331,8 @@ pthread_handler_decl(handle_slave,arg __attribute__((unused)))
} }
connected: connected:
mysql->net.timeout=slave_net_timeout;
while (!slave_killed(thd)) while (!slave_killed(thd))
{ {
thd->proc_info = "Requesting binlog dump"; thd->proc_info = "Requesting binlog dump";
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment