diff options
author | unknown <jimw@mysql.com> | 2005-08-08 18:05:27 -0700 |
---|---|---|
committer | unknown <jimw@mysql.com> | 2005-08-08 18:05:27 -0700 |
commit | ac28ad5dcab32a351bc0bc9e1ada806d3037fc8e (patch) | |
tree | 19a939ef1572e8f0e78d8fcaa154c81746a7d7b0 /sql | |
parent | 31ebc6ef71afaf4605ab5d00ddaf8d548683212d (diff) | |
download | mariadb-git-ac28ad5dcab32a351bc0bc9e1ada806d3037fc8e.tar.gz |
Avoid problems on shutdown by shutting down replication slave threads
after normal connection threads. (Bug #11796)
sql/mysqld.cc:
Move call to end_slave() after first loop through killing threads,
to minimize chances of 'SHOW SLAVE STATUS' being called between the
time the slave is shut down and connections are shut down.
Diffstat (limited to 'sql')
-rw-r--r-- | sql/mysqld.cc | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/sql/mysqld.cc b/sql/mysqld.cc index 896114f98c6..394dd3294de 100644 --- a/sql/mysqld.cc +++ b/sql/mysqld.cc @@ -648,7 +648,6 @@ static void close_connections(void) } #endif end_thr_alarm(0); // Abort old alarms. - end_slave(); /* First signal all threads that it's time to die @@ -664,6 +663,9 @@ static void close_connections(void) { DBUG_PRINT("quit",("Informing thread %ld that it's time to die", tmp->thread_id)); + /* We skip slave threads on this first loop through. */ + if (tmp->slave_thread) continue; + tmp->killed= 1; if (tmp->mysys_var) { @@ -680,6 +682,8 @@ static void close_connections(void) } (void) pthread_mutex_unlock(&LOCK_thread_count); // For unlink from list + end_slave(); + if (thread_count) sleep(2); // Give threads time to die |