Commit 9189284b authored by Sergei Golubchik's avatar Sergei Golubchik

remove a race-condition prone assertion

on shutdown it might happen that
1. the server starts killing THDs
2. it sets thd->killed in srv_purge_coordinator
3. srv_purge_coordinator notices that and tells srv_workers to exit
4. srv_worker will notice that and will start exiting,
    ... assert here ...
5. server sets thd->killed in worker threads

that is, it might happen that the assert is tested before
srv_worker's THD got the kill signal.

this fixes various random crashes (on this assertion) on shutdown
in tests
parent 3d12587c
...@@ -2720,7 +2720,6 @@ DECLARE_THREAD(srv_worker_thread)( ...@@ -2720,7 +2720,6 @@ DECLARE_THREAD(srv_worker_thread)(
ut_a(!purge_sys->running); ut_a(!purge_sys->running);
ut_a(purge_sys->state == PURGE_STATE_EXIT); ut_a(purge_sys->state == PURGE_STATE_EXIT);
ut_a(srv_shutdown_state > SRV_SHUTDOWN_NONE || thd_kill_level(thd));
rw_lock_x_unlock(&purge_sys->latch); rw_lock_x_unlock(&purge_sys->latch);
......
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