summaryrefslogtreecommitdiff
path: root/sql/mysqld.cc
diff options
context:
space:
mode:
Diffstat (limited to 'sql/mysqld.cc')
-rw-r--r--sql/mysqld.cc14
1 files changed, 12 insertions, 2 deletions
diff --git a/sql/mysqld.cc b/sql/mysqld.cc
index 696740109da..2bfebdaa90b 100644
--- a/sql/mysqld.cc
+++ b/sql/mysqld.cc
@@ -1570,8 +1570,11 @@ static my_bool kill_thread_phase_1(THD *thd, int *n_threads_awaiting_ack)
++(*n_threads_awaiting_ack)))
return 0;
- if (DBUG_IF("only_kill_system_threads") ? !thd->system_thread : 0)
+ if (DBUG_IF("only_kill_system_threads") && !thd->system_thread)
return 0;
+ if (DBUG_IF("only_kill_system_threads_no_loop") && !thd->system_thread)
+ return 0;
+
thd->awake(KILL_SERVER_HARD);
return 0;
}
@@ -1781,7 +1784,6 @@ static void close_connections(void)
Events::deinit();
slave_prepare_for_shutdown();
- mysql_bin_log.stop_background_thread();
ack_receiver.stop();
/*
@@ -1802,7 +1804,11 @@ static void close_connections(void)
for (int i= 0; THD_count::connection_thd_count() - n_threads_awaiting_ack
&& i < 1000; i++)
+ {
+ if (DBUG_IF("only_kill_system_threads_no_loop"))
+ break;
my_sleep(20000);
+ }
if (global_system_variables.log_warnings)
server_threads.iterate(warn_threads_active_after_phase_1);
@@ -1819,7 +1825,11 @@ static void close_connections(void)
THD_count::connection_thd_count() - n_threads_awaiting_ack));
while (THD_count::connection_thd_count() - n_threads_awaiting_ack)
+ {
+ if (DBUG_IF("only_kill_system_threads_no_loop"))
+ break;
my_sleep(1000);
+ }
/* Kill phase 2 */
server_threads.iterate(kill_thread_phase_2);