mariadb/mysql-test/suite/sys_vars
Sergey Vojtovich a4052183df MDEV-37890 - sys_vars.thread_cache_size_func fails sporadically
Removed redundant FLUSH STATUS, doesn't serve any purpose in this test.

Shrinking thread_cache_size is done without appropriate mutex protection
and it doesn't flush thread cache. It means we may have more threads in
the cache than thread_cache_size allows.

First FLUSH THREADS (line 36) was added just in case
thread_cache_size_func-master.opt file is removed and raising
thread_cache_size from 0 to 3 becomes shrinking from the default value
to 3.

Second FLUSH THREADS (line 81) was added to fix timeout in wait
condition (line 100). It serves as a barrier that guarantees fourth
preceding disconnect won't pick one of subsequent connects and in turn
leave 2 threads in the cache.

Threads_cached cannot be queried for exact value because there can
(or cannot) be disconnecting threads from previous tests or mtr utility
connection. There is also a gap between server_threads.erase() (aka
removal from I_S.PROCESSLIST) and thread_cache.park() (aka
Threads_cached++). All in all it makes Threads_cached value
unpredictable after thread_cache_size is set to 3.

Instead of querying for exact value, just make sure Threads_cached
doesn't exceed thread_cache_size.
2025-10-20 15:39:29 +04:00
..
inc Merge 10.6 into 10.11 2025-05-26 08:10:47 +03:00
r MDEV-37890 - sys_vars.thread_cache_size_func fails sporadically 2025-10-20 15:39:29 +04:00
t MDEV-37890 - sys_vars.thread_cache_size_func fails sporadically 2025-10-20 15:39:29 +04:00
disabled.def MDEV-21452: Replace ib_mutex_t with mysql_mutex_t 2020-12-15 17:56:18 +02:00