mariadb/tpool
Vladislav Vaintroub 21395bbb6c MDEV-37728: Fix shutdown deadlock between thr_timer_end and set_period
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.
2025-09-24 22:25:59 +02:00
..
aio_libaio.cc Fixed that valgrind can be used with InnoDB using aio on Linux. 2025-09-04 18:08:39 +03:00
aio_liburing.cc Fixed that valgrind can be used with InnoDB using aio on Linux. 2025-09-04 18:08:39 +03:00
aio_linux.cc MDEV-36482: Make libaio work WITH_MSAN=ON 2025-06-26 10:05:36 +03:00
aio_simulated.cc MDEV-36234: Add innodb_linux_aio 2025-06-23 13:51:52 +03:00
aio_win.cc MDEV-36234: Add innodb_linux_aio 2025-06-23 13:51:52 +03:00
CMakeLists.txt MDEV-36234: Add innodb_linux_aio 2025-06-23 13:51:52 +03:00
task.cc MDEV-24512 fixup: Remove after_task_callback 2021-09-14 16:23:23 +03:00
task_group.cc MDEV-11026 Make InnoDB number of IO write/read threads dynamic 2022-06-27 12:00:31 +02:00
tpool.h MDEV-36234: Add innodb_linux_aio 2025-06-23 13:51:52 +03:00
tpool_generic.cc MDEV-37728: Fix shutdown deadlock between thr_timer_end and set_period 2025-09-24 22:25:59 +02:00
tpool_structs.h Merge 10.6 into 10.11 2023-11-22 18:14:11 +02:00
tpool_win.cc MDEV-36234: Add innodb_linux_aio 2025-06-23 13:51:52 +03:00
wait_notification.cc tpool - misc fixes 2020-01-12 21:34:59 +01:00