Bug 534934 - mochitest-ipcplugins: OSError: [Errno 10] No child process, r=bsmedberg
authorJonathan Griffin <jgriffin@mozilla.com>
Tue, 15 Dec 2009 20:21:51 -0500
changeset 36278 2012cd379192e6193206d6f9d8eefae4822f35cb
parent 36277 69674697dbce469745f1baaccb507cca27afd1e8
child 36279 1786c396fd102ba03cb8b8aecc4fcdc373aa710e
push id1
push userroot
push dateTue, 26 Apr 2011 22:38:44 +0000
treeherdermozilla-beta@bfdb6e623a36 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersbsmedberg
bugs534934
milestone1.9.3a1pre
Bug 534934 - mochitest-ipcplugins: OSError: [Errno 10] No child process, r=bsmedberg
build/automation.py.in
--- a/build/automation.py.in
+++ b/build/automation.py.in
@@ -521,25 +521,27 @@ else:
     return (f.readline(), False)
 
   def isPidAlive(pid):
     try:
       # kill(pid, 0) checks for a valid PID without actually sending a signal
       # The method throws OSError if the PID is invalid, which we catch below.
       os.kill(pid, 0)
 
-      # wait on it to see if it's a zombie
+      # Wait on it to see if it's a zombie. This can throw OSError.ECHILD if
+      # the process terminates before we get to this point.
       wpid, wstatus = os.waitpid(pid, os.WNOHANG)
       if wpid == 0:
         return True
 
       return False
     except OSError, err:
-      # Catch the one error we expect from os.kill, and re-raise any others
-      if err.errno == errno.ESRCH:
+      # Catch the errors we might expect from os.kill/os.waitpid, 
+      # and re-raise any others
+      if err.errno == errno.ESRCH or err.errno == errno.ECHILD:
         return False
       raise
 
   def killPid(pid):
     os.kill(pid, signal.SIGKILL)
 
 def triggerBreakpad(proc, utilityPath):
   """Attempt to kill this process in a way that triggers Breakpad crash