Commit bd20fb87 authored by Monty's avatar Monty

Write error message ebfore aborting if not all memory is released

Also don't abort if global_status_var.global_memory_used != 0 on not
normal exit as then it's likely that not all memory is released.
parent 157f2b25
...@@ -2161,15 +2161,15 @@ static void mysqld_exit(int exit_code) ...@@ -2161,15 +2161,15 @@ static void mysqld_exit(int exit_code)
shutdown_performance_schema(); // we do it as late as possible shutdown_performance_schema(); // we do it as late as possible
#endif #endif
set_malloc_size_cb(NULL); set_malloc_size_cb(NULL);
if (!opt_debugging && !my_disable_leak_check) if (opt_endinfo && global_status_var.global_memory_used)
fprintf(stderr, "Warning: Memory not freed: %ld\n",
(long) global_status_var.global_memory_used);
if (!opt_debugging && !my_disable_leak_check && exit_code == 0)
{ {
DBUG_ASSERT(global_status_var.global_memory_used == 0); DBUG_ASSERT(global_status_var.global_memory_used == 0);
} }
cleanup_tls(); cleanup_tls();
DBUG_LEAVE; DBUG_LEAVE;
if (opt_endinfo && global_status_var.global_memory_used)
fprintf(stderr, "Warning: Memory not freed: %ld\n",
(long) global_status_var.global_memory_used);
sd_notify(0, "STATUS=MariaDB server is down"); sd_notify(0, "STATUS=MariaDB server is down");
exit(exit_code); /* purecov: inspected */ exit(exit_code); /* purecov: inspected */
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment