1
0
mirror of https://github.com/MariaDB/server.git synced 2025-07-30 16:24:05 +03:00

Simplified away init_new_connection_thread()

It was meaningful only for one-thread-per-connection scheduler anyway,
so call init_new_connection_handler_thread() directly from
handle_one_connection().

It was somewhat harmful for no-threads scheduler, because it'd attempt to
detach main thread on AIX_3_2 and Siemens unix (and DEC OSF/1 3.2 too).
Also it does duplicate my_thread_init() call, which may produce a warning
under EXTRA_DEBUG_THREADS.

start_wsrep_THD() shouldn't have called it at all: it already detached
and called my_thread_init().

Part of MDEV-19515 - Improve connect speed
This commit is contained in:
Sergey Vojtovich
2019-05-19 01:04:22 +04:00
parent 8d9d4aa6d6
commit 6900aaf417
6 changed files with 9 additions and 25 deletions

View File

@ -1303,6 +1303,14 @@ pthread_handler_t handle_one_connection(void *arg)
mysql_thread_set_psi_id(connect->thread_id);
if (init_new_connection_handler_thread())
{
scheduler_functions *scheduler= connect->scheduler;
connect->close_with_error(0, 0, ER_OUT_OF_RESOURCES);
scheduler->end_thread(0, 0);
return 0;
}
do_handle_one_connection(connect);
return 0;
}
@ -1340,8 +1348,7 @@ void do_handle_one_connection(CONNECT *connect)
{
ulonglong thr_create_utime= microsecond_interval_timer();
THD *thd;
if (connect->scheduler->init_new_connection_thread() ||
!(thd= connect->create_thd(NULL)))
if (!(thd= connect->create_thd(NULL)))
{
scheduler_functions *scheduler= connect->scheduler;
connect->close_with_error(0, 0, ER_OUT_OF_RESOURCES);