Commit 08b0b70d authored by Vladislav Vaintroub's avatar Vladislav Vaintroub

MDEV-24084 Fix race between disconnect and KILL CONNECTION

Prior to this patch, it is possible to access freed memory
(THD::event_scheduler) from tp_post_kill_notification().

With this patch, memory is freed only when THD is no more accessible
from other threads, i.e after it is removed from the thread_list.
parent 75e7132f
......@@ -202,12 +202,11 @@ void tp_callback(TP_connection *c)
error:
c->thd= 0;
delete c;
if (thd)
{
threadpool_remove_connection(thd);
}
delete c;
worker_context.restore();
}
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment