Commit 46b79b8c authored by Sergei Golubchik's avatar Sergei Golubchik

MDEV-30084 Shutdown hangs in some tests

debug-only issue. the test was doing

  set debug_sync='now SIGNAL go3';
  ...
  set debug_sync='reset';

which translated into

  add "go3" to the hash of active signals
  pthread_broadcast to wake up waiting threads
  ...
  clear the hash of active signals

as a result a waiting thread was awoken, but the hash was emptied
before the thread checked if its signal was in the hash. so the
thread didn't find its signal and went back to sleep.

let's wait until the awoken thread has completely finished
disconnecting and was added to the thread cache.
parent f6ecadfe
......@@ -234,6 +234,7 @@ connection default;
set debug_sync='now WAIT_FOR go0';
set debug_sync='found_killee SIGNAL go1 WAIT_FOR go2';
kill $id;
select variable_value into @threads_cached from information_schema.global_status where variable_name='threads_cached';
set debug_sync='now SIGNAL go3';
drop table t1;
set debug_sync='reset';
......@@ -313,6 +313,12 @@ connection default;
set debug_sync='now WAIT_FOR go0';
set debug_sync='found_killee SIGNAL go1 WAIT_FOR go2';
evalp kill $id;
select variable_value into @threads_cached from information_schema.global_status where variable_name='threads_cached';
set debug_sync='now SIGNAL go3';
if (`select @@thread_handling != 'pool-of-threads'`) {
# cannot check that a thread was added to thread pool on windows, but the test works there w/o the wait
let wait_condition= select variable_value>@threads_cached from information_schema.global_status where variable_name='threads_cached';
source include/wait_condition.inc;
}
drop table t1;
set debug_sync='reset';
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment