Fix leak of SSL caches for auxiliary threads

Whenever a thread creates MySQL connections using SSL params the
thread-local caches are populated. These thread-local resources need to
be free on thread exit via 'mysql_thread_end', otherwise these objects
will be leak. This is not relevant for the fixed size thread-pools, but
it's for workloads making use of temporary/auxiliary threads.
pull/4808/head
Javier Jaramago Fernández 1 year ago
parent 643b62ddfb
commit ac3e75244c

@ -103,7 +103,7 @@ class ConsumerThread : public Thread {
m_queue.add(item);
}
// this is intentional to EXIT immediately
return NULL;
goto cleanup;
}
@ -123,6 +123,9 @@ class ConsumerThread : public Thread {
delete item->data;
delete item;
}
cleanup:
// De-initializes per-thread structures. Required in all auxiliary threads using MySQL and SSL.
mysql_thread_end();
return NULL;
}
};

@ -329,6 +329,8 @@ __exit_kill_query_thread:
delete ssl_params;
ssl_params = NULL;
}
// De-initializes per-thread structures. Required in all auxiliary threads using MySQL and SSL.
mysql_thread_end();
return NULL;
}

Loading…
Cancel
Save