Skip to content

Commit 9ec2129

Browse files
committed
Fixed bug in mtr that caused restart to fail if mysqld died to fast
1 parent 552bb1a commit 9ec2129

File tree

3 files changed

+12
-4
lines changed

3 files changed

+12
-4
lines changed

mysql-test/include/restart_mysqld.inc

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,3 +8,8 @@
88

99
--source include/shutdown_mysqld.inc
1010
--source include/start_mysqld.inc
11+
12+
# The following sleep is required to give sleep_until_file_created() time
13+
# to notice that the server was restarted. sleep_until_file_created() would
14+
# fail if the server was restarted or killed at once after restart.
15+
--sleep 0.1

mysql-test/include/wait_until_connected_again.inc

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,10 @@ while ($mysql_errno)
3333
{
3434
let $mysql_errno=0;
3535
}
36-
--sleep 0.1
36+
if ($mysql_errno > 0)
37+
{
38+
--sleep 0.1
39+
}
3740
}
3841
--enable_query_log
3942
--enable_result_log

mysql-test/lib/mtr_process.pl

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -107,10 +107,10 @@ ($$$$)
107107
my $timeout= shift;
108108
my $proc= shift;
109109
my $warn_seconds = shift;
110-
my $sleeptime= 100; # Milliseconds
111-
my $loops= ($timeout * 1000) / $sleeptime;
110+
my $sleeptime= 10; # Milliseconds
111+
my $loops= ($timeout * 10000) / $sleeptime;
112112

113-
for ( my $loop= 1; $loop <= $loops; $loop++ )
113+
for ( my $loop= 0; $loop <= $loops; $loop++ )
114114
{
115115
if ( -r $pidfile )
116116
{

0 commit comments

Comments
 (0)