diff options
author | Monty <monty@mariadb.org> | 2015-09-01 18:40:54 +0300 |
---|---|---|
committer | Monty <monty@mariadb.org> | 2015-09-01 18:42:02 +0300 |
commit | 4f0255cbf9df7b0dca507cbdcc753ae7821a47a4 (patch) | |
tree | 41af0c227d33af2aca7e7651270915e8ee1a5c8a /sql/signal_handler.cc | |
parent | 56aa19989f5800df8a398173727558bfb3ea1251 (diff) | |
download | mariadb-git-4f0255cbf9df7b0dca507cbdcc753ae7821a47a4.tar.gz |
Fixed errors and bugs found by valgrind:
- If run with valgrind, mysqltest will now wait longer when syncronizing slave with master
- Ensure that we wait with cleanup() until slave thread has stopped.
- Added signal_thd_deleted() to signal close_connections() that all THD's has been freed.
- Check in handle_fatal_signal() that we don't use variables that has been freed.
- Increased some timeouts when run with --valgrind
Other things:
- Fixed wrong test in one_thread_per_connection_end() if galera is used.
- Removed not needed calls to THD_CHECK_SENTRY() when we are calling 'delete thd'.
Diffstat (limited to 'sql/signal_handler.cc')
-rw-r--r-- | sql/signal_handler.cc | 41 |
1 files changed, 24 insertions, 17 deletions
diff --git a/sql/signal_handler.cc b/sql/signal_handler.cc index 61e2830e82e..4490aae6b62 100644 --- a/sql/signal_handler.cc +++ b/sql/signal_handler.cc @@ -110,8 +110,9 @@ extern "C" sig_handler handle_fatal_signal(int sig) set_server_version(); my_safe_printf_stderr("Server version: %s\n", server_version); - my_safe_printf_stderr("key_buffer_size=%lu\n", - (ulong) dflt_key_cache->key_cache_mem_size); + if (dflt_key_cache) + my_safe_printf_stderr("key_buffer_size=%lu\n", + (ulong) dflt_key_cache->key_cache_mem_size); my_safe_printf_stderr("read_buffer_size=%ld\n", (long) global_system_variables.read_buff_size); @@ -119,24 +120,30 @@ extern "C" sig_handler handle_fatal_signal(int sig) my_safe_printf_stderr("max_used_connections=%lu\n", (ulong) max_used_connections); - my_safe_printf_stderr("max_threads=%u\n", - (uint) thread_scheduler->max_threads + - (uint) extra_max_connections); + if (thread_scheduler) + my_safe_printf_stderr("max_threads=%u\n", + (uint) thread_scheduler->max_threads + + (uint) extra_max_connections); my_safe_printf_stderr("thread_count=%u\n", (uint) thread_count); - my_safe_printf_stderr("It is possible that mysqld could use up to \n" - "key_buffer_size + " - "(read_buffer_size + sort_buffer_size)*max_threads = " - "%lu K bytes of memory\n", - (ulong)(dflt_key_cache->key_cache_mem_size + - (global_system_variables.read_buff_size + - global_system_variables.sortbuff_size) * - (thread_scheduler->max_threads + extra_max_connections) + - (max_connections + extra_max_connections)* sizeof(THD)) / 1024); - - my_safe_printf_stderr("%s", - "Hope that's ok; if not, decrease some variables in the equation.\n\n"); + if (dflt_key_cache && thread_scheduler) + { + my_safe_printf_stderr("It is possible that mysqld could use up to \n" + "key_buffer_size + " + "(read_buffer_size + sort_buffer_size)*max_threads = " + "%lu K bytes of memory\n", + (ulong) + (dflt_key_cache->key_cache_mem_size + + (global_system_variables.read_buff_size + + global_system_variables.sortbuff_size) * + (thread_scheduler->max_threads + extra_max_connections) + + (max_connections + extra_max_connections) * + sizeof(THD)) / 1024); + my_safe_printf_stderr("%s", + "Hope that's ok; if not, decrease some variables in " + "the equation.\n\n"); + } #ifdef HAVE_STACKTRACE thd= current_thd; |