BUG#20598
Fix race between cleanup and thread kill at server shutdown that would sometimes prevent proper cleanup, leading to Valgrind warnings. sql/mysqld.cc: Move logger cleanup to avoid races with thread kill.
This commit is contained in:
parent
cb28cf8d88
commit
860c104d87
@ -1266,13 +1266,13 @@ void clean_up(bool print_message)
|
||||
MYF(MY_WME | MY_FAE | MY_ALLOW_ZERO_PTR));
|
||||
DBUG_PRINT("quit", ("Error messages freed"));
|
||||
/* Tell main we are ready */
|
||||
logger.cleanup_end();
|
||||
(void) pthread_mutex_lock(&LOCK_thread_count);
|
||||
DBUG_PRINT("quit", ("got thread count lock"));
|
||||
ready_to_exit=1;
|
||||
/* do the broadcast inside the lock to ensure that my_end() is not called */
|
||||
(void) pthread_cond_broadcast(&COND_thread_count);
|
||||
(void) pthread_mutex_unlock(&LOCK_thread_count);
|
||||
logger.cleanup_end();
|
||||
|
||||
/*
|
||||
The following lines may never be executed as the main thread may have
|
||||
|
Loading…
x
Reference in New Issue
Block a user