MXS-2026 Separate QC process and thread initialization
qc_thread_init() must now explicitly be called in every thread and not just in other threads but the one where qc_process_init() is called. This change was caused by QC_INIT_SELF initialization actually being performed in query_classifier.cc. Before this change, there actually was a leak in the routing worker running in the main thread, the query classification cache was created twice.
This commit is contained in:
@ -397,13 +397,14 @@ int main()
|
||||
pConfig->n_threads = 1;
|
||||
|
||||
set_libdir(MXS_STRDUP_A("../../../../../query_classifier/qc_sqlite/"));
|
||||
if (qc_setup(NULL, QC_SQL_MODE_DEFAULT, "qc_sqlite", "") &&
|
||||
qc_process_init(QC_INIT_BOTH) &&
|
||||
qc_thread_init(QC_INIT_BOTH))
|
||||
if (qc_setup(NULL, QC_SQL_MODE_DEFAULT, "qc_sqlite", "")
|
||||
&& qc_process_init(QC_INIT_BOTH)
|
||||
&& qc_thread_init(QC_INIT_BOTH))
|
||||
{
|
||||
set_libdir(MXS_STRDUP_A("../"));
|
||||
rc = test();
|
||||
|
||||
qc_thread_end(QC_INIT_BOTH);
|
||||
qc_process_end(QC_INIT_BOTH);
|
||||
}
|
||||
else
|
||||
|
Reference in New Issue
Block a user