summaryrefslogtreecommitdiff
path: root/client
diff options
context:
space:
mode:
authorAndrei Elkin <andrei.elkin@mariadb.com>2020-08-20 15:32:35 +0300
committerAndrei Elkin <andrei.elkin@mariadb.com>2020-08-21 14:48:53 +0300
commita19cb3884f443e68eecfa7b96ea109768a0a6188 (patch)
tree25f868a7969f50c6e57e48156cff776c59c8e89a /client
parenta43faf6b165b78cda9be8d1d11afb7aa2681c4ed (diff)
downloadmariadb-git-a19cb3884f443e68eecfa7b96ea109768a0a6188.tar.gz
MDEV-23511 shutdown_server 10 times out, causing server kill at shutdown
Shutdown of mtr tests may be too impatient, esp on CI environment where 10 seconds of `arg` of `shutdown_server arg` may not be enough for the clean shutdown to complete. This is fixed to remove explicit non-zero timeout argument to `shutdown_server` from all mtr tests. mysqltest computes 60 seconds default value for the timeout for the argless `shutdown_server` command. This policy is additionally ensured with a compile time assert.
Diffstat (limited to 'client')
-rw-r--r--client/mysqltest.cc6
1 files changed, 4 insertions, 2 deletions
diff --git a/client/mysqltest.cc b/client/mysqltest.cc
index 7d2b4b3b0a7..2a9560e8903 100644
--- a/client/mysqltest.cc
+++ b/client/mysqltest.cc
@@ -185,7 +185,7 @@ static uint opt_tail_lines= 0;
static uint opt_connect_timeout= 0;
static uint opt_wait_for_pos_timeout= 0;
-
+static const uint default_wait_for_pos_timeout= 300;
static char delimiter[MAX_DELIMITER_LENGTH]= ";";
static uint delimiter_length= 1;
@@ -5074,6 +5074,8 @@ void do_shutdown_server(struct st_command *command)
};
DBUG_ENTER("do_shutdown_server");
+ /* the wait-for-pos' default based value of 'timeout' must fit to MDEV-23511 */
+ compile_time_assert(default_wait_for_pos_timeout / 5 >= 60);
check_command_args(command, command->first_argument, shutdown_args,
sizeof(shutdown_args)/sizeof(struct command_arg),
' ');
@@ -7058,7 +7060,7 @@ static struct my_option my_long_options[] =
{"wait_for_pos_timeout", 0,
"Number of seconds to wait for master_pos_wait",
&opt_wait_for_pos_timeout, &opt_wait_for_pos_timeout, 0, GET_UINT,
- REQUIRED_ARG, 300, 0, 3600 * 12, 0, 0, 0},
+ REQUIRED_ARG, default_wait_for_pos_timeout, 0, 3600 * 12, 0, 0, 0},
{"plugin_dir", 0, "Directory for client-side plugins.",
&opt_plugin_dir, &opt_plugin_dir, 0,
GET_STR, REQUIRED_ARG, 0, 0, 0, 0, 0, 0},