mirror of
https://github.com/MariaDB/server.git
synced 2025-01-17 20:42:30 +01:00
08ce9bfe05
This bug only happens with long sleep()s ( > 5 sec), and in debug version. Analysis: The assertion is caused by nested thd_wait_begin() calls, which is not an expected condition. - "outer" thd_wait_begin()) , in Item_func_sleep::val_int() - "inner" thd_wait_begin() in Interruptible_wait::wait(). This function periodically checks whether connection is still valid, via THD::is_connection(), which ends up calling vio_io_wait() with timeout parameter set to 0. Fix is not to call thd wait callback in vio_io_wait(), if timeout parameter is 0. There is no "waiting" in this case.
90 lines
2.3 KiB
Text
90 lines
2.3 KiB
Text
# Start with thread_handling=pool-of-threads
|
|
# and run a number of tests
|
|
|
|
-- source include/have_pool_of_threads.inc
|
|
SET @save_optimizer_switch=@@optimizer_switch;
|
|
SET optimizer_switch='outer_join_with_cache=off';
|
|
# Slow test, don't run during staging part
|
|
-- source include/not_staging.inc
|
|
-- source include/long_test.inc
|
|
-- source include/common-tests.inc
|
|
SET optimizer_switch=@save_optimizer_switch;
|
|
|
|
# Test that we cannot have more simultaneous connections than
|
|
# --thread-pool-size on the standard port, but _can_ have additional
|
|
# connections on the extra port.
|
|
|
|
# First set two connections running, and check that extra connection
|
|
# on normal port fails due to--thread-pool-max_threads=2
|
|
connection default;
|
|
|
|
# Sleep for slightly longer than 5 sec to trigger MDEV-4566
|
|
# (abort in interruptible wait connection check)
|
|
send SELECT sleep(5.5);
|
|
--sleep 1
|
|
|
|
connect(con2,localhost,root,,);
|
|
connection con2;
|
|
send SELECT sleep(5);
|
|
--sleep 0.5
|
|
|
|
--disable_abort_on_error
|
|
--disable_result_log
|
|
--disable_query_log
|
|
connect(con3,localhost,root,,);
|
|
--enable_query_log
|
|
--enable_result_log
|
|
--enable_abort_on_error
|
|
let $error = $mysql_errno;
|
|
if (!$error)
|
|
{
|
|
--echo # -- Error: managed to establish more than --thread_pool_max_threads connections
|
|
}
|
|
if ($error)
|
|
{
|
|
--echo # -- Success: more than --thread_pool_max_threads normal connections not possible
|
|
}
|
|
|
|
connection default;
|
|
--reap
|
|
connection con2;
|
|
--reap
|
|
|
|
# Now try again, but this time use the extra port to successfully connect.
|
|
|
|
connection default;
|
|
send SELECT sleep(5);
|
|
|
|
connection con2;
|
|
send SELECT sleep(5);
|
|
--sleep 1
|
|
|
|
connect(extracon,127.0.0.1,root,,test,$MASTER_EXTRA_PORT,);
|
|
connection extracon;
|
|
SELECT 'Connection on extra port ok';
|
|
|
|
connect(extracon2,127.0.0.1,root,,test,$MASTER_EXTRA_PORT,);
|
|
connection extracon2;
|
|
SELECT 'Connection on extra port 2 ok';
|
|
|
|
--disable_abort_on_error
|
|
--disable_result_log
|
|
--disable_query_log
|
|
connect(extracon3,127.0.0.1,root,,test,$MASTER_EXTRA_PORT,);
|
|
--enable_query_log
|
|
--enable_result_log
|
|
--enable_abort_on_error
|
|
let $error = $mysql_errno;
|
|
if (!$error)
|
|
{
|
|
--echo # -- Error: managed to establish more than --extra-max-connections + 1 connections
|
|
}
|
|
if ($error)
|
|
{
|
|
--echo # -- Success: more than --extra-max-connections + 1 normal connections not possible
|
|
}
|
|
|
|
connection default;
|
|
--reap
|
|
connection con2;
|
|
--reap
|