mirror of
https://github.com/MariaDB/server.git
synced 2025-07-30 16:24:05 +03:00
MDEV-33150 double-locking of LOCK_thd_kill in performance_schema.session_status
perfschema thread walker needs to take thread's LOCK_thd_kill to prevent the thread from disappearing why it's being looked at. But there's no need to lock it for the current thread. In fact, it was harmful as some code down the stack might take LOCK_thd_kill (e.g. set_killed() does it, and my_malloc_size_cb_func() calls set_killed()). And it caused a bunch of mutexes being locked under LOCK_thd_kill, which created problems later when my_malloc_size_cb_func() called set_killed() at some unspecified point under some random mutexes.
This commit is contained in:
18
mysql-test/suite/perfschema/t/misc_session_status.test
Normal file
18
mysql-test/suite/perfschema/t/misc_session_status.test
Normal file
@ -0,0 +1,18 @@
|
||||
--source include/not_embedded.inc
|
||||
--source include/have_perfschema.inc
|
||||
--echo #
|
||||
--echo # MDEV-33150 double-locking of LOCK_thd_kill in performance_schema.session_status
|
||||
--echo #
|
||||
source include/have_innodb.inc;
|
||||
set @old_innodb_io_capacity=@@global.innodb_io_capacity;
|
||||
set @old_innodb_io_capacity_max=@@global.innodb_io_capacity_max;
|
||||
select * from performance_schema.session_status limit 0; # discover the table
|
||||
set max_session_mem_used=32768;
|
||||
--error ER_OPTION_PREVENTS_STATEMENT
|
||||
# this used to crash, when OOM happened under LOCK_thd_kill
|
||||
select * from performance_schema.session_status;
|
||||
# this used to cause mutex lock order violation when OOM happened under LOCK_global_system_variables
|
||||
set global innodb_io_capacity_max=100;
|
||||
set max_session_mem_used=default;
|
||||
set global innodb_io_capacity=@old_innodb_io_capacity;
|
||||
set global innodb_io_capacity_max=@old_innodb_io_capacity_max;
|
Reference in New Issue
Block a user