From d6651864773afc2b7534285ee0d50d4fd6b47e9c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marko=20M=C3=A4kel=C3=A4?= Date: Wed, 19 Apr 2023 14:08:53 +0300 Subject: [PATCH] MDEV-28976: mtr must wait for server to actually die do_shutdown_server(): Call wait_until_dead() also when we are forcibly killing the process (timeout=0). We have evidence that killing the process may take some time and cause mystery failures in crash recovery tests. For InnoDB, several failures were observed between commit da094188f60bf67e3d90227304a4ea256fe2630f and commit 0ee1082bd2e7e7049c4f0e686bad53cf7ba053ab when no advisory file locking was being used by default. --- client/mysqltest.cc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/client/mysqltest.cc b/client/mysqltest.cc index 6330d4f881d..9e9b122c5fe 100644 --- a/client/mysqltest.cc +++ b/client/mysqltest.cc @@ -5191,7 +5191,7 @@ void do_shutdown_server(struct st_command *command) if (timeout) (void) my_kill(pid, SIGABRT); /* Give server a few seconds to die in all cases */ - if (!timeout || wait_until_dead(pid, timeout < 5 ? 5 : timeout)) + if (wait_until_dead(pid, timeout < 5 ? 5 : timeout)) { (void) my_kill(pid, SIGKILL); }