MXS-1929: Split housekeeper initialization

The initialization and starting of the housekeeper is now done
separately. This allows housekeeper tasks to be created when the services
are being created while still preventing the execution of the task before
the startup is complete.
This commit is contained in:
Markus Mäkelä
2018-07-21 12:26:31 +03:00
parent 843b8d92eb
commit a553ddba6e
3 changed files with 29 additions and 3 deletions

View File

@ -1969,6 +1969,15 @@ int main(int argc, char **argv)
goto return_main;
}
// Initialize the housekeeper
if (!hkinit())
{
const char* logerr = "Failed to initialize housekeeper";
print_log_n_stderr(true, true, logerr, logerr, 0);
rc = MAXSCALE_INTERNALERROR;
goto return_main;
}
if (!config_load(cnf_file_path))
{
const char* fprerr =
@ -2071,7 +2080,7 @@ int main(int argc, char **argv)
}
// Start the housekeeper thread
if (!hkinit())
if (!hkstart())
{
const char* logerr = "Failed to start housekeeper thread.";
print_log_n_stderr(true, true, logerr, logerr, 0);