mirror of
https://github.com/MariaDB/server.git
synced 2025-07-30 16:24:05 +03:00
Merge pilot.(none):/data/msvensson/mysql/bug25657/my50-bug25657-new2
into pilot.(none):/data/msvensson/mysql/bug25657/my51-bug25657 mysql-test/lib/mtr_process.pl: Auto merged mysql-test/lib/mtr_timer.pl: Auto merged mysql-test/mysql-test-run.pl: Merge 5.0->5.1
This commit is contained in:
@ -613,6 +613,11 @@ sub mtr_check_stop_servers ($) {
|
||||
if ( $pid )
|
||||
{
|
||||
# Server is still alive, put it in list to be hard killed
|
||||
if ($::glob_win32_perl)
|
||||
{
|
||||
# Kill the real process if it's known
|
||||
$pid= $srv->{'real_pid'} if ($srv->{'real_pid'});
|
||||
}
|
||||
$kill_pids{$pid}= 1;
|
||||
|
||||
# Write a message to the process's error log (if it has one)
|
||||
@ -666,6 +671,16 @@ sub mtr_check_stop_servers ($) {
|
||||
}
|
||||
}
|
||||
|
||||
if ($::glob_win32_perl and $srv->{'real_pid'})
|
||||
{
|
||||
# Wait for the pseudo pid - if the real_pid was known
|
||||
# the pseudo pid has not been waited for yet, wai blocking
|
||||
# since it's "such a simple program"
|
||||
mtr_verbose("Wait for pseudo process $srv->{'pid'}");
|
||||
my $ret_pid= waitpid($srv->{'pid'}, 0);
|
||||
mtr_verbose("Pseudo process $ret_pid died");
|
||||
}
|
||||
|
||||
$srv->{'pid'}= 0;
|
||||
}
|
||||
}
|
||||
@ -1043,7 +1058,7 @@ sub sleep_until_file_created ($$$) {
|
||||
{
|
||||
if ( -r $pidfile )
|
||||
{
|
||||
return $pid;
|
||||
return 1;
|
||||
}
|
||||
|
||||
# Check if it died after the fork() was successful
|
||||
|
@ -97,9 +97,14 @@ sub mtr_timer_start($$$) {
|
||||
# clearing the signal handler.
|
||||
$SIG{INT}= 'DEFAULT';
|
||||
|
||||
$SIG{TERM}= sub {
|
||||
mtr_verbose("timer woke up, exiting!");
|
||||
exit(0);
|
||||
};
|
||||
|
||||
$0= "mtr_timer(timers,$name,$duration)";
|
||||
mtr_verbose("timer child $name, sleep $duration");
|
||||
sleep($duration);
|
||||
mtr_verbose("timer expired after $duration seconds");
|
||||
exit(0);
|
||||
}
|
||||
}
|
||||
@ -118,7 +123,7 @@ sub mtr_timer_stop ($$) {
|
||||
|
||||
# FIXME as Cygwin reuses pids fast, maybe check that is
|
||||
# the expected process somehow?!
|
||||
kill(9, $tpid);
|
||||
kill(15, $tpid);
|
||||
|
||||
# As the timers are so simple programs, we trust them to terminate,
|
||||
# and use blocking wait for it. We wait just to avoid a zombie.
|
||||
|
Reference in New Issue
Block a user