Fix to bug #510, http://bugs.skysql.com/show_bug.cgi?id=510, made every MaxScale thread to call mysql_thread_init() before entering poll_waitevents. Also main thread does this before starting services. Removed all calls to mysql_thread_init() and to mysql_thread_end() from elsewhere than from poll.c:poll_waitevents and from gateway.c:main

skygw_utils.cc: replace_literal: fixed memory leak
This commit is contained in:
VilhoRaatikka
2014-09-01 19:37:31 +03:00
parent 3c1abf4b64
commit 0fed5c2c5b
5 changed files with 21 additions and 17 deletions

View File

@ -1339,11 +1339,16 @@ int main(int argc, char **argv)
/* Init MaxScale poll system */
poll_init();
/*<
* Start the services that were created above
*/
/**
* Init mysql thread context for main thread as well. Needed when users
* are queried from backends.
*/
mysql_thread_init();
/** Start the services that were created above */
n_services = serviceStartAll();
if (n_services == 0)
if (n_services == 0)
{
char* logerr = "Failed to start any MaxScale services. Exiting.";
print_log_n_stderr(true, !daemon_mode, logerr, logerr, 0);
@ -1396,9 +1401,13 @@ int main(int argc, char **argv)
/*< Stop all the monitors */
monitorStopAll();
LOGIF(LM, (skygw_log_write(
LOGFILE_MESSAGE,
"MaxScale is shutting down.")));
/** Release mysql thread context*/
mysql_thread_end();
datadir_cleanup();
LOGIF(LM, (skygw_log_write(
LOGFILE_MESSAGE,