From 801b45bf4fb5ba4bf26fe4f733270b2a6a4234cd Mon Sep 17 00:00:00 2001 From: Alexey Botchkov Date: Mon, 24 Jan 2022 19:51:27 +0400 Subject: [PATCH] MDEV-26890 : Crash on shutdown, with active binlog dump threads Backported from 10.7. The reason for the crash was a bug in MDEV-19275, after which shutdown does not wait for binlog threads anymore. --- sql/mysqld.cc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sql/mysqld.cc b/sql/mysqld.cc index de2e1c7622e..a1a8a862a8e 100644 --- a/sql/mysqld.cc +++ b/sql/mysqld.cc @@ -1814,7 +1814,7 @@ static void close_connections(void) /* Kill phase 2 */ server_threads.iterate(kill_thread_phase_2); - for (uint64 i= 0; THD_count::connection_thd_count(); i++) + for (uint64 i= 0; THD_count::value() > local_connection_thread_count; i++) { /* This time the warnings are emitted within the loop to provide a