Skip to content

Commit

Permalink
Fixed bug in mtr that caused restart to fail if mysqld died to fast
Browse files Browse the repository at this point in the history
  • Loading branch information
montywi committed May 26, 2021
1 parent 552bb1a commit 9ec2129
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 4 deletions.
5 changes: 5 additions & 0 deletions mysql-test/include/restart_mysqld.inc
Original file line number Diff line number Diff line change
Expand Up @@ -8,3 +8,8 @@

--source include/shutdown_mysqld.inc
--source include/start_mysqld.inc

# The following sleep is required to give sleep_until_file_created() time
# to notice that the server was restarted. sleep_until_file_created() would
# fail if the server was restarted or killed at once after restart.
--sleep 0.1
5 changes: 4 additions & 1 deletion mysql-test/include/wait_until_connected_again.inc
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,10 @@ while ($mysql_errno)
{
let $mysql_errno=0;
}
--sleep 0.1
if ($mysql_errno > 0)
{
--sleep 0.1
}
}
--enable_query_log
--enable_result_log
6 changes: 3 additions & 3 deletions mysql-test/lib/mtr_process.pl
Original file line number Diff line number Diff line change
Expand Up @@ -107,10 +107,10 @@ ($$$$)
my $timeout= shift;
my $proc= shift;
my $warn_seconds = shift;
my $sleeptime= 100; # Milliseconds
my $loops= ($timeout * 1000) / $sleeptime;
my $sleeptime= 10; # Milliseconds
my $loops= ($timeout * 10000) / $sleeptime;

for ( my $loop= 1; $loop <= $loops; $loop++ )
for ( my $loop= 0; $loop <= $loops; $loop++ )
{
if ( -r $pidfile )
{
Expand Down

0 comments on commit 9ec2129

Please sign in to comment.