Commit b79b3ff6 authored by mkaruza's avatar mkaruza Committed by Jan Lindström

MDEV-23468: inline_mysql_socket_send: Assertion `mysql_socket.fd != -1' failed on shutdown

Closing remaining threads in `wsrep_close_client_connections` should also
check `thd_is_connection_alive` for thd before closing connection. Assert is
happening when thread already doing shutdown, but still not removed from threads
list.
Reviewed-by: default avatarJan Lindström <jan.lindstrom@mariadb.com>
parent 41a961d8
......@@ -46,6 +46,7 @@
#include <cstdlib>
#include <string>
#include "log_event.h"
#include "sql_connect.h"
#include <sstream>
......@@ -2441,10 +2442,12 @@ static my_bool kill_remaining_threads(THD *thd, THD *caller_thd)
if (is_client_connection(thd) &&
!abort_replicated(thd) &&
!is_replaying_connection(thd) &&
thd_is_connection_alive(thd) &&
thd != caller_thd)
{
WSREP_INFO("killing local connection: %lld", (longlong) thd->thread_id);
close_connection(thd, 0);
close_connection(thd);
}
#endif
return 0;
......
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