Skip to content

Commit 50b32fd

Browse files
BUG#26580041: PUSH OF WL#9644 CAUSED REGRESSION SERVER
SHUTDOWN ANALYSIS: ========= Shutdown time of server with empty database increased two fold. During shutdown, we close all the connections to the server. During that stage, first we signal all threads that they need to be killed. This will give them some time to gracefully abort their statements and inform their clients that the server is about to die. There is a hardcoded sleep in the code which gives time for the threads to die if they are not killed already. Event scheduler is now enabled by default and thus the event scheduler thread needs to be killed explicitly after all the client connections are killed. This thread was killed after the sleep and hence triggered the sleep everytime there was a shutdown because this thread was still active. Thus the shutdown time increased. FIX: ==== The event scheduler is now stopped and the thread is killed before the sleep after all the client connections are signalled to die. Do note that, when we try to stop the event scheduler, an acknowledgement from the scheduler that it has stopped, is necessary. Already running events will not be stopped.
1 parent c099068 commit 50b32fd

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

sql/mysqld.cc

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1712,6 +1712,10 @@ static void close_connections(void)
17121712
set_kill_conn.set_dump_thread_flag();
17131713
thd_manager->do_for_all_thd(&set_kill_conn);
17141714
}
1715+
1716+
// Disable the event scheduler
1717+
Events::stop();
1718+
17151719
if (thd_manager->get_thd_count() > 0)
17161720
sleep(2); // Give threads time to die
17171721

0 commit comments

Comments
 (0)