#At file:///Users/tnurnberg/forest/48388/55-48388/ based on revid:dao-gang.qu@stripped
3229 Tatiana Azundris Nurnberg 2011-01-20
Bug#48388: additional logging for shutting down threads
Adds shutdown notices for communication threads (clients, slaves).
Adds shutdown notices for plug-ins/engines that can be supplemented
by more detailed ones from the individual engines.
@ sql/mysqld.cc
add shutdown notices for comms threads (clients/slaves)
@ sql/sql_plugin.cc
add shutdown notices for plug-ins/engines. this provides a fallback
if the plug-in itself does not provide more detailed diagnostics.
modified:
sql/mysqld.cc
sql/sql_plugin.cc
=== modified file 'sql/mysqld.cc'
--- a/sql/mysqld.cc 2010-12-29 00:26:31 +0000
+++ b/sql/mysqld.cc 2011-01-20 11:47:44 +0000
@@ -1073,6 +1073,8 @@ static void close_connections(void)
statements and inform their clients that the server is about to die.
*/
+ sql_print_information("giving client threads a chance to die gracefully");
+
THD *tmp;
mysql_mutex_lock(&LOCK_thread_count); // For unlink from list
@@ -1105,6 +1107,8 @@ static void close_connections(void)
mysql_mutex_unlock(&LOCK_thread_count); // For unlink from list
Events::deinit();
+
+ sql_print_information("shutting down slave threads");
end_slave();
if (thread_count)
@@ -1116,6 +1120,7 @@ static void close_connections(void)
client on a blocking read call are aborted.
*/
+ sql_print_information("forcefully disconnecting remaining clients");
for (;;)
{
DBUG_PRINT("quit",("Locking LOCK_thread_count"));
@@ -1416,6 +1421,7 @@ void clean_up(bool print_message)
make sure that handlers finish up
what they have that is dependent on the binlog
*/
+ sql_print_information("binlog end");
ha_binlog_end(current_thd);
logger.cleanup_base();
=== modified file 'sql/sql_plugin.cc'
--- a/sql/sql_plugin.cc 2010-12-02 07:16:26 +0000
+++ b/sql/sql_plugin.cc 2011-01-20 11:47:44 +0000
@@ -957,7 +957,10 @@ static void reap_plugins(void)
list= reap;
while ((plugin= *(--list)))
+ {
+ sql_print_information("Shutting down plugin '%s'", plugin->name.str);
plugin_deinitialize(plugin, true);
+ }
mysql_mutex_lock(&LOCK_plugin);
Attachment: [text/bzr-bundle] bzr/azundris@sun.com-20110120114744-okq3qwfah72kz07r.bundle