Skip to content

Commit 1b7a794

Browse files
committed
MDEV-11540 Unexpected system threads in the process list
name innodb background threads as such
1 parent 8541626 commit 1b7a794

File tree

2 files changed

+4
-0
lines changed

2 files changed

+4
-0
lines changed

sql/sql_class.cc

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -796,6 +796,7 @@ THD::THD(my_thread_id id, bool is_wsrep_applier)
796796
mysql_audit_init_thd(this);
797797
net.vio=0;
798798
net.buff= 0;
799+
net.reading_or_writing= 0;
799800
client_capabilities= 0; // minimalistic client
800801
system_thread= NON_SYSTEM_THREAD;
801802
cleanup_done= free_connection_done= abort_on_warning= 0;
@@ -4448,6 +4449,7 @@ MYSQL_THD create_thd()
44484449
thd->store_globals();
44494450
thd->set_command(COM_DAEMON);
44504451
thd->system_thread= SYSTEM_THREAD_GENERIC;
4452+
thd->security_ctx->host_or_ip="";
44514453
add_to_active_threads(thd);
44524454
return thd;
44534455
}

storage/innobase/handler/ha_innodb.cc

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -329,6 +329,7 @@ thd_destructor_proxy(void *)
329329

330330
thd_destructor_myvar = _my_thread_var();
331331
THD *thd= create_thd();
332+
thd_proc_info(thd, "InnoDB background thread");
332333

333334
mysql_mutex_lock(&thd_destructor_mutex);
334335
thd_destructor_myvar->current_mutex = &thd_destructor_mutex;
@@ -1779,6 +1780,7 @@ innobase_create_background_thd()
17791780
/*============================*/
17801781
{
17811782
MYSQL_THD thd= create_thd();
1783+
thd_proc_info(thd, "InnoDB background thread");
17821784
THDVAR(thd, background_thread) = true;
17831785
return thd;
17841786
}

0 commit comments

Comments
 (0)