List:Commits« Previous MessageNext Message »
From:msvensson Date:June 20 2007 11:55am
Subject:bk commit into 5.0 tree (msvensson:1.2533) BUG#25657
View as plain text  
Below is the list of changes that have just been committed into a local
5.0 repository of msvensson. When msvensson does a push these changes will
be propagated to the main repository and, within 24 hours after the
push, to the public repository.
For information on how to access the public repository
see http://dev.mysql.com/doc/mysql/en/installing-source-tree.html

ChangeSet@stripped, 2007-06-20 11:55:02+02:00, msvensson@pilot.(none) +3 -0
  Bug#25657 mysql-test-run.pl kill itself under ActiveState perl
   - Various fixes for running mysql-test-run.pl on ActiveState perl
     for windows. Reading it's source in win32/win32.c helps... 

  mysql-test/lib/mtr_process.pl@stripped, 2007-06-20 11:55:01+02:00, msvensson@pilot.(none)
+16 -1
    Use "real_pid" when killing the process on ActiveState perl for windows
    Wait blocking for the pseudo pid to exit.
    Change "sleep_until_file_created" to return 1 when pidfile has been
    created - this should avoid early wakeup if $pid was 0

  mysql-test/lib/mtr_timer.pl@stripped, 2007-06-20 11:55:02+02:00, msvensson@pilot.(none) +7
-2
    Wake timer process with signal 15 to avoid to avoid resource leak
    on ActiveState perl for windows.
    Install signal handler in timer process to  exit gracefully

  mysql-test/mysql-test-run.pl@stripped, 2007-06-20 11:55:01+02:00, msvensson@pilot.(none)
+18 -10
    Read "real_pid" of process from pid_file - to be used when killing the
    process oin ActiveState perl
    Drop the --console option to mysqld
    Pass "real_pid" to mtr_check_stop_server so it can select to use it
    Correct tow argument declaration 

# This is a BitKeeper patch.  What follows are the unified diffs for the
# set of deltas contained in the patch.  The rest of the patch, the part
# that BitKeeper cares about, is below these diffs.
# User:	msvensson
# Host:	pilot.(none)
# Root:	/data/msvensson/mysql/bug25657/my50-bug25657-new

--- 1.58/mysql-test/lib/mtr_process.pl	2007-06-15 10:46:48 +02:00
+++ 1.59/mysql-test/lib/mtr_process.pl	2007-06-20 11:55:01 +02:00
@@ -611,6 +611,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)
@@ -664,6 +669,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;
       }
     }
@@ -1041,7 +1056,7 @@ sub sleep_until_file_created ($$$) {
   {
     if ( -r $pidfile )
     {
-      return $pid;
+      return 1;
     }
 
     # Check if it died after the fork() was successful

--- 1.12/mysql-test/lib/mtr_timer.pl	2006-12-30 18:29:18 +01:00
+++ 1.13/mysql-test/lib/mtr_timer.pl	2007-06-20 11:55:02 +02:00
@@ -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.

--- 1.228/mysql-test/mysql-test-run.pl	2007-06-14 17:04:14 +02:00
+++ 1.229/mysql-test/mysql-test-run.pl	2007-06-20 11:55:01 +02:00
@@ -2579,10 +2579,19 @@ sub ndbcluster_wait_started($$){
 sub mysqld_wait_started($){
   my $mysqld= shift;
 
-  my $res= sleep_until_file_created($mysqld->{'path_pid'},
-				    $mysqld->{'start_timeout'},
-				    $mysqld->{'pid'});
-  return $res == 0;
+  if (sleep_until_file_created($mysqld->{'path_pid'},
+			       $mysqld->{'start_timeout'},
+			       $mysqld->{'pid'}) == 0)
+  {
+    # Failed to wait for pid file
+    return 1;
+  }
+
+  # Get the "real pid" of the process, it will be used for killing
+  # the process in ActiveState's perl on windows
+  $mysqld->{'real_pid'}= mtr_get_pid_from_file($mysqld->{'path_pid'});
+
+  return 0;
 }
 
 
@@ -3720,7 +3729,6 @@ sub mysqld_arguments ($$$$) {
 
   mtr_add_arg($args, "%s--no-defaults", $prefix);
 
-  mtr_add_arg($args, "%s--console", $prefix);
   mtr_add_arg($args, "%s--basedir=%s", $prefix, $path_my_basedir);
   mtr_add_arg($args, "%s--character-sets-dir=%s", $prefix, $path_charsetsdir);
 
@@ -3769,7 +3777,6 @@ sub mysqld_arguments ($$$$) {
   mtr_add_arg($args, "%s--datadir=%s", $prefix,
 	      $mysqld->{'path_myddir'});
 
-
   if ( $mysql_version_id >= 50106 )
   {
     # Turn on logging to bothe tables and file
@@ -4094,6 +4101,7 @@ sub stop_all_servers () {
 
       push(@kill_pids,{
 		       pid      => $mysqld->{'pid'},
+		       real_pid => $mysqld->{'real_pid'},
 		       pidfile  => $mysqld->{'path_pid'},
 		       sockfile => $mysqld->{'path_sock'},
 		       port     => $mysqld->{'port'},
@@ -4301,6 +4309,7 @@ sub run_testcase_stop_servers($$$) {
 
 	push(@kill_pids,{
 			 pid      => $mysqld->{'pid'},
+			 real_pid => $mysqld->{'real_pid'},
 			 pidfile  => $mysqld->{'path_pid'},
 			 sockfile => $mysqld->{'path_sock'},
 			 port     => $mysqld->{'port'},
@@ -4352,6 +4361,7 @@ sub run_testcase_stop_servers($$$) {
 
 	push(@kill_pids,{
 			 pid      => $mysqld->{'pid'},
+			 real_pid => $mysqld->{'real_pid'},
 			 pidfile  => $mysqld->{'path_pid'},
 			 sockfile => $mysqld->{'path_sock'},
 			 port     => $mysqld->{'port'},
@@ -4776,12 +4786,10 @@ sub run_mysqltest ($) {
     mtr_add_arg($args, "%s", $_) for @args_saved;
   }
 
-  mtr_add_arg($args, "--test-file");
-  mtr_add_arg($args, $tinfo->{'path'});
+  mtr_add_arg($args, "--test-file=%s", $tinfo->{'path'});
 
   if ( defined $tinfo->{'result_file'} ) {
-    mtr_add_arg($args, "--result-file");
-    mtr_add_arg($args, $tinfo->{'result_file'});
+    mtr_add_arg($args, "--result-file=%s", $tinfo->{'result_file'});
   }
 
   if ( $opt_record )
Thread
bk commit into 5.0 tree (msvensson:1.2533) BUG#25657msvensson20 Jun