mirror of
https://github.com/MariaDB/server.git
synced 2025-09-27 11:29:12 +02:00
![]() The mysys timer (thr_timer) could deadlock with srv_thread_pool_end() due to lock inversion: - LOCK_timer is held during the entire timer action routine. - timer action executed in mysys thread may lock timer_generic::m_mtx. - main thread holding the same timer_generic::m_mtx calls thr_timer_end(), which also needs LOCK_timer. This inversion can cause a very rare shutdown deadlock, when the threadpool extends the maintenance() period after idling for a minute and shutdown occurs simultaneously. Workaround: Use try_lock in timer_generic::set_period() to avoid blocking, to break the deadlock cycle, and ignore errors. Root cause is the thr_timer holds the global LOCK_timer for the entire duration of every timer action. This makes it difficult or impossible to use additional locks safely inside timer routines. Fortunately, in this case a failed try_lock has no impact. |
||
---|---|---|
.. | ||
aio_libaio.cc | ||
aio_liburing.cc | ||
aio_linux.cc | ||
aio_simulated.cc | ||
aio_win.cc | ||
CMakeLists.txt | ||
task.cc | ||
task_group.cc | ||
tpool.h | ||
tpool_generic.cc | ||
tpool_structs.h | ||
tpool_win.cc | ||
wait_notification.cc |