From a2a08eda8aa1c2256b49d552ed82d54b57b20aeb Mon Sep 17 00:00:00 2001 From: Vladislav Vaintroub Date: Fri, 22 Sep 2023 13:37:07 +0200 Subject: [PATCH] MDEV-27943 - reduce calls to mysql_socket_set_thread_owner() in threadpool It is enough to just once, during connection phase --- sql/threadpool_common.cc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sql/threadpool_common.cc b/sql/threadpool_common.cc index 78f9eaf8792..10b7db4eb7e 100644 --- a/sql/threadpool_common.cc +++ b/sql/threadpool_common.cc @@ -199,7 +199,6 @@ static void thread_attach(THD* thd) DBUG_ASSERT(thd->mysys_var == my_thread_var); thd->mysys_var->stack_ends_here= thd->thread_stack + tinfo->stack_size; PSI_CALL_set_thread(thd->get_psi()); - mysql_socket_set_thread_owner(thd->net.vio->mysql_socket); } /* @@ -313,6 +312,7 @@ static THD *threadpool_add_connection(CONNECT *connect, TP_connection *c) /* Login. */ thread_attach(thd); + mysql_socket_set_thread_owner(thd->net.vio->mysql_socket); re_init_net_server_extension(thd); ulonglong now= microsecond_interval_timer(); thd->prior_thr_create_utime= now;