MXS-2196: Start listeners after worker threads

If the startup of the listeners requires communication with all of the
workers, the workers must be up and running for that to happen.

Due to the fact that the main thread is still a worker thread, the
initialization code is not extra straightforward. By queuing an event to
the main worker, the startup of all listeners is done at a fully
operational state with all workers fully functional.

The service initialization code was also flawed in the sense that it would
cause a deadlock if any of the threads would have to check for the user
permissions. This is mainly a problem with the authenticator modules but
the benefits of the per service pre-loading of users is most likely
superficial. In theory startup will be faster as each thread now queries
the users in parallel.
This commit is contained in:
Markus Mäkelä
2018-12-02 11:21:49 +02:00
parent 015c581a5b
commit 7aa60b4a24
4 changed files with 42 additions and 50 deletions

View File

@ -558,7 +558,7 @@ bool RoutingWorker::pre_run()
{
this_thread.current_worker_id = m_id;
bool rv = modules_thread_init() && service_thread_init() && qc_thread_init(QC_INIT_SELF);
bool rv = modules_thread_init() && qc_thread_init(QC_INIT_SELF);
if (!rv)
{