Skip to content

Commit 9cb8e9c

Browse files
Andrzej Religabjornmu
authored andcommitted
BUG 22900099 - MAX VALUE FOR IDLE_WORKER_THREAD_TIMEOUT SHOULD BE 1 HOUR.
Description: The max value for the idle_worker_thread_timeout system variable was value of maximum unsigned int. This was changed to more reasonable 1h value. RB: 12070 Reviewed by: Grzegorz Szwarc <[email protected]> Reviewed by: Lukasz Kotula <[email protected]> (cherry picked from commit 583d58d2f8589081fa0b6104a0e5b015ba3ee87c)
1 parent e0e8450 commit 9cb8e9c

File tree

3 files changed

+13
-1
lines changed

3 files changed

+13
-1
lines changed

mysql-test/suite/xplugin/r/mysqlx_server_var.result

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -55,6 +55,10 @@ SET @@global.mysqlx_idle_worker_thread_timeout=7;
5555
show variables like 'mysqlx_idle_worker_thread_timeout';
5656
Variable_name Value
5757
mysqlx_idle_worker_thread_timeout 7
58+
SET @@global.mysqlx_idle_worker_thread_timeout=3600;
59+
show variables like 'mysqlx_idle_worker_thread_timeout';
60+
Variable_name Value
61+
mysqlx_idle_worker_thread_timeout 3600
5862
SET mysqlx_idle_worker_thread_timeout=7;
5963
ERROR HY000: Variable 'mysqlx_idle_worker_thread_timeout' is a GLOBAL variable and should be set with SET GLOBAL
6064
SET @@local.mysqlx_idle_worker_thread_timeout=7;
@@ -65,6 +69,9 @@ SET @@session.mysqlx_idle_worker_thread_timeout=7;
6569
ERROR HY000: Variable 'mysqlx_idle_worker_thread_timeout' is a GLOBAL variable and should be set with SET GLOBAL
6670
SET SESSION mysqlx_idle_worker_thread_timeout=7;
6771
ERROR HY000: Variable 'mysqlx_idle_worker_thread_timeout' is a GLOBAL variable and should be set with SET GLOBAL
72+
SET @@global.mysqlx_idle_worker_thread_timeout=3601;
73+
Warnings:
74+
Warning 1292 Truncated incorrect mysqlx_idle_worker_thread_timeou value: '3601'
6875
SET GLOBAL mysqlx_idle_worker_thread_timeout=0;
6976
SET GLOBAL mysqlx_idle_worker_thread_timeout=-1;
7077
Warnings:

mysql-test/suite/xplugin/t/mysqlx_server_var.test

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -73,6 +73,9 @@ show variables like 'mysqlx_idle_worker_thread_timeout';
7373
SET GLOBAL mysqlx_idle_worker_thread_timeout=7;
7474
SET @@global.mysqlx_idle_worker_thread_timeout=7;
7575
show variables like 'mysqlx_idle_worker_thread_timeout';
76+
#Max valid value
77+
SET @@global.mysqlx_idle_worker_thread_timeout=3600;
78+
show variables like 'mysqlx_idle_worker_thread_timeout';
7679

7780
## Invalid cases
7881
--error ER_GLOBAL_VARIABLE
@@ -85,6 +88,8 @@ SET @@mysqlx_idle_worker_thread_timeout=7;
8588
SET @@session.mysqlx_idle_worker_thread_timeout=7;
8689
--error ER_GLOBAL_VARIABLE
8790
SET SESSION mysqlx_idle_worker_thread_timeout=7;
91+
# Warning: Truncated incorrect mysqlx_idle_worker_thread_timeout value
92+
SET @@global.mysqlx_idle_worker_thread_timeout=3601;
8893

8994
#--error ER_GLOBAL_VARIABLE
9095
SET GLOBAL mysqlx_idle_worker_thread_timeout=0;

rapid/plugin/x/src/xpl_plugin.cc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -136,7 +136,7 @@ static MYSQL_SYSVAR_UINT(min_worker_threads, xpl::Plugin_system_variables::min_w
136136
static MYSQL_SYSVAR_UINT(idle_worker_thread_timeout, xpl::Plugin_system_variables::idle_worker_thread_timeout,
137137
PLUGIN_VAR_OPCMDARG,
138138
"Time after which an idle worker thread is terminated (in seconds).",
139-
NULL, &xpl::Plugin_system_variables::update_func<unsigned int>, 60, 0, std::numeric_limits<unsigned int>::max(), 0);
139+
NULL, &xpl::Plugin_system_variables::update_func<unsigned int>, 60, 0, 60 * 60, 0);
140140

141141
static MYSQL_SYSVAR_UINT(max_allowed_packet, xpl::Plugin_system_variables::max_allowed_packet,
142142
PLUGIN_VAR_OPCMDARG,

0 commit comments

Comments
 (0)