Skip to content

Commit 47df0ba

Browse files
Cherry-pick of 'mariadb-test: wait on disconnect' from 12.1
Cherry-picks mysqltest.cc and rpl_semi_sync_shutdown_await_ack changes from 12.1 to fix a race condition on disconnect.
1 parent c96a4fd commit 47df0ba

File tree

2 files changed

+6
-2
lines changed

2 files changed

+6
-2
lines changed

client/mysqltest.cc

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5767,8 +5767,12 @@ void do_close_connection(struct st_command *command)
57675767
DBUG_PRINT("info", ("Closing connection %s", con->name));
57685768
#ifndef EMBEDDED_LIBRARY
57695769
if (command->type == Q_DIRTY_CLOSE)
5770-
{
57715770
mariadb_cancel(con->mysql);
5771+
else
5772+
{
5773+
simple_command(con->mysql,COM_QUIT,0,0,0);
5774+
if (con->util_mysql)
5775+
simple_command(con->util_mysql,COM_QUIT,0,0,0);
57725776
}
57735777
#endif /*!EMBEDDED_LIBRARY*/
57745778
if (con->stmt)

mysql-test/suite/rpl/t/rpl_semi_sync_shutdown_await_ack.test

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -219,7 +219,7 @@ SET GLOBAL debug_dbug="+d,simulate_delay_semisync_slave_reply";
219219
--connection server_2
220220
set debug_sync= "now wait_for io_thd_at_slave_reply";
221221

222-
--disconnect con1
222+
--dirty_close con1
223223

224224
--connection default
225225
--write_file $MYSQLTEST_VARDIR/tmp/mysqld.1.expect

0 commit comments

Comments
 (0)