Skip to content

Commit

Permalink
Fixed random failure in main.kill_processlist-6619
Browse files Browse the repository at this point in the history
The problem was that SHOW PROCESSLIST was done before the command of
the default connection was cleared.

Reviewer: Sergei Golubchik <serg@mariadb.org>
  • Loading branch information
montywi committed Mar 1, 2024
1 parent 3254687 commit 8b3f470
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 0 deletions.
6 changes: 6 additions & 0 deletions mysql-test/main/kill_processlist-6619.result
Original file line number Diff line number Diff line change
@@ -1,11 +1,17 @@
SET DEBUG_SYNC='dispatch_command_end SIGNAL ready WAIT_FOR go';
select 1;
connect con1,localhost,root,,;
SET DEBUG_SYNC='now wait_for ready';
SET DEBUG_SYNC='now signal go';
SHOW PROCESSLIST;
Id User Host db Command Time State Info Progress
# root # test Sleep # # NULL 0.000
# root # test Query # # SHOW PROCESSLIST 0.000
SET DEBUG_SYNC='before_execute_sql_command SIGNAL ready WAIT_FOR go';
SHOW PROCESSLIST;
connection default;
1
1
SET DEBUG_SYNC='now WAIT_FOR ready';
KILL QUERY con_id;
SET DEBUG_SYNC='now SIGNAL go';
Expand Down
9 changes: 9 additions & 0 deletions mysql-test/main/kill_processlist-6619.test
Original file line number Diff line number Diff line change
Expand Up @@ -4,14 +4,23 @@
--source include/not_embedded.inc
--source include/have_debug_sync.inc

# This is to ensure that the following SHOW PROCESSLIST does not show the query
SET DEBUG_SYNC='dispatch_command_end SIGNAL ready WAIT_FOR go';
--send select 1

--connect (con1,localhost,root,,)
SET DEBUG_SYNC='now wait_for ready';
SET DEBUG_SYNC='now signal go';

--let $con_id = `SELECT CONNECTION_ID()`
--replace_result Execute Query
--replace_column 1 # 3 # 6 # 7 #
SHOW PROCESSLIST;
SET DEBUG_SYNC='before_execute_sql_command SIGNAL ready WAIT_FOR go';
send SHOW PROCESSLIST;
--connection default
--reap

# We must wait for the SHOW PROCESSLIST query to have started before sending
# the kill. Otherwise, the KILL may be lost since it is reset at the start of
# query execution.
Expand Down

0 comments on commit 8b3f470

Please sign in to comment.