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-10-30 20:34:58+01:00, msvensson@stripped +2 -0
Add special waitpid loop for Win32perl since it can't waitpid(-1)
Add fallback to overload to make eq and ne work as "usual"
Print more debug info if a process can't be found in running list
mysql-test/lib/My/SafeProcess.pm@stripped, 2007-10-30 20:34:57+01:00, msvensson@stripped +29 -10
Add special waitpid loop for Win32perl since it can't waitpid(-1)
Add fallback to overload to make eq and ne work as "usual"
Print more debug info if a process can't be found in running list
mysql-test/mysql-test-run.pl@stripped, 2007-10-30 20:34:57+01:00, msvensson@stripped +1 -1
Print what process just exited if running in verbose mode
diff -Nrup a/mysql-test/lib/My/SafeProcess.pm b/mysql-test/lib/My/SafeProcess.pm
--- a/mysql-test/lib/My/SafeProcess.pm 2007-10-29 15:55:50 +01:00
+++ b/mysql-test/lib/My/SafeProcess.pm 2007-10-30 20:34:57 +01:00
@@ -340,15 +340,39 @@ sub wait {
# exited or undefined
#
sub wait_any {
- my $ret_pid= waitpid(-1, 0);
-
- # No more processes to wait for
- return undef if $ret_pid <= 0;
+ my $ret_pid;
+ if (IS_WIN32PERL) {
+ # Can't wait for -1 => use a polling loop
+ do {
+ Win32::Sleep(10); # 10 milli seconds
+ foreach my $pid (keys %running){
+ $ret_pid= waitpid($pid, &WNOHANG);
+ last if $pid == $ret_pid;
+ }
+ } while ($ret_pid == 0);
+
+ # Special processig of return code
+ # since negative pids are valid
+ if ($ret_pid == 0 or $ret_pid == -1) {
+ print STDERR "wait_any, got invalid pid: $ret_pid\n";
+ return undef;
+ }
+ }
+ else
+ {
+ $ret_pid= waitpid(-1, 0);
+ if ($ret_pid <= 0){
+ # No more processes to wait for
+ print STDERR "wait_any, got invalid pid: $ret_pid\n";
+ return undef;
+ }
+ }
# Look it up in "running" table
my $proc= $running{$ret_pid};
unless (defined $proc){
print STDERR "Could not find pid in running list\n";
+ print STDERR "running: ". join(", ", keys(%running)). "\n";
return undef;
}
$proc->_collect;
@@ -358,7 +382,7 @@ sub wait_any {
use overload
'""' => \&self2str,
- 'eq' => \&self2eq;
+ fallback => 1;
# Return the process as a nicely formatted string
@@ -373,11 +397,6 @@ sub self2str {
$str.= ", winpid: $winpid" if defined $winpid;
$str.= ", exit: $exit_status" if defined $exit_status;
$str.= "]";
-}
-
-sub self2eq {
- my ($self)= @_;
- return $self;
}
diff -Nrup a/mysql-test/mysql-test-run.pl b/mysql-test/mysql-test-run.pl
--- a/mysql-test/mysql-test-run.pl 2007-10-30 19:05:25 +01:00
+++ b/mysql-test/mysql-test-run.pl 2007-10-30 20:34:57 +01:00
@@ -3239,7 +3239,7 @@ sub run_testcase ($) {
# MASV FIXME Should not terminate program
mtr_error("wait_any failed");
}
-
+ mtr_verbose("Got $proc");
# Was it the test program that exited
if ($proc eq $test)
{
| Thread |
|---|
| • bk commit into 5.0 tree (msvensson:1.2564) | msvensson | 30 Oct |