mirror of
https://github.com/MariaDB/server.git
synced 2025-07-30 16:24:05 +03:00
Fix two races in test main.processlist that could cause random failures (seen in Buildbot)
1. Do not use NULL `info' field in processlist to select the thread of interest. This can fail if the read of processlist ends up happening after REAP succeeds, but before the `info' field is reset. Instead, select on the CONNECTION_ID(), making sure we still scan the whole list to trigger the same code as in the original test case. 2. Wait for the query to really complete before reading it in the processlist. When REAP returns, it only means that ack has been sent to client, the reset of query stage happens a bit later in the code.
This commit is contained in:
@ -1,15 +1,17 @@
|
||||
SET DEBUG_SYNC = 'dispatch_command_before_set_time WAIT_FOR do_set_time';
|
||||
SELECT 1;
|
||||
SET DEBUG_SYNC = 'fill_schema_processlist_after_unow SIGNAL do_set_time WAIT_FOR fill_schema_proceed';
|
||||
SELECT INFO,TIME,TIME_MS FROM INFORMATION_SCHEMA.PROCESSLIST WHERE INFO IS NULL;
|
||||
SELECT ID, TIME,TIME_MS FROM INFORMATION_SCHEMA.PROCESSLIST WHERE CONCAT(":", ID, ":") = ":TID:";
|
||||
1
|
||||
1
|
||||
SET DEBUG_SYNC = 'now SIGNAL fill_schema_proceed';
|
||||
INFO TIME TIME_MS
|
||||
NULL 0 0.000
|
||||
ID TIME TIME_MS
|
||||
TID 0 0.000
|
||||
SET DEBUG_SYNC = 'dispatch_command_end SIGNAL query_done';
|
||||
select sleep(5);
|
||||
sleep(5)
|
||||
0
|
||||
SET DEBUG_SYNC = 'now WAIT_FOR query_done';
|
||||
select command, time < 5 from information_schema.processlist where id != connection_id();
|
||||
command time < 5
|
||||
Sleep 1
|
||||
|
Reference in New Issue
Block a user