List:Commits« Previous MessageNext Message »
From:knielsen Date:February 11 2006 10:40pm
Subject:bk commit into 4.1 tree (knielsen:1.2478)
View as plain text  
Below is the list of changes that have just been committed into a local
4.1 repository of knielsen. When knielsen 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
  1.2478 06/02/11 22:40:18 knielsen@stripped +1 -0
  Fix a race on some platforms in mysql-test-run.pl, where it would sometimes
  errorneously abort reporting failure to kill child processes, where in
  reality the problem was merely that the child had become a zombie because
  of missing waitpid() call.

  mysql-test/lib/mtr_process.pl
    1.21 06/02/11 22:37:52 knielsen@stripped +9 -1
    Fix race (on some platforms) when killing processes.

# 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:	knielsen
# Host:	rt.int.sifira.dk
# Root:	/usr/local/mysql/mysql-4.1-fixrace

--- 1.20/mysql-test/lib/mtr_process.pl	2005-09-28 23:53:13 +02:00
+++ 1.21/mysql-test/lib/mtr_process.pl	2006-02-11 22:37:52 +01:00
@@ -770,7 +770,15 @@
 }
 
 sub start_reap_all {
-  $SIG{CHLD}= 'IGNORE';                 # FIXME is this enough?
+  # This causes terminating processes to not become zombies, avoiding
+  # the need for (or possibility of) explicit waitpid().
+  $SIG{CHLD}= 'IGNORE';
+
+  # On some platforms (Linux, QNX, OSX, ...) there is potential race
+  # here. If a process terminated before setting $SIG{CHLD} (but after
+  # any attempt to waitpid() it), it will still be a zombie. So we
+  # have to handle any such process here.
+  while(waitpid(-1, &WNOHANG) > 0) { };
 }
 
 sub stop_reap_all {
Thread
bk commit into 4.1 tree (knielsen:1.2478)knielsen11 Feb