extras-buildsys/builder builder.py,1.44,1.45

Daniel Williams (dcbw) fedora-extras-commits at redhat.com
Tue Oct 25 04:43:47 UTC 2005


Author: dcbw

Update of /cvs/fedora/extras-buildsys/builder
In directory cvs-int.fedora.redhat.com:/tmp/cvs-serv14902/builder

Modified Files:
	builder.py 
Log Message:
2005-10-25  Dan Williams  <dcbw at redhat.com>

    * builder/builder.py
        - (_handle_death): don't forget about a job when it gets killed,
            but doesn't have an mock subprocess (for example, if the job
            is in the 'downloaded' state)




Index: builder.py
===================================================================
RCS file: /cvs/fedora/extras-buildsys/builder/builder.py,v
retrieving revision 1.44
retrieving revision 1.45
diff -u -r1.44 -r1.45
--- builder.py	5 Oct 2005 17:43:59 -0000	1.44
+++ builder.py	25 Oct 2005 04:43:45 -0000	1.45
@@ -131,21 +131,26 @@
         self._log("Killing build process...\n")
 
         # Don't try to kill a running cleanup process
-        if self._status != 'cleanup' and self._childpid:
-            try:
-                os.kill(self._childpid, 9)
-            except OSError, e:
-                self._log("ERROR: Couldn't kill process %d: %s\n" % (self._childpid, e))
-            else:
-                # Ensure child process is reaped
-                self._log("Waiting for mock process %d to exit...\n" % self._childpid)
+        if self._status != 'cleanup':
+            # Kill a running non-cleanup mock process, if any
+            if self._childpid:
                 try:
-                    (pid, status) = os.waitpid(self._childpid, 0)
+                    os.kill(self._childpid, 9)
                 except OSError, e:
-                    pass
-                self._log("Mock process %d exited.\n" % self._childpid)
-            self._childpid = 0
+                    self._log("ERROR: Couldn't kill process %d: %s\n" % (self._childpid, e))
+                else:
+                    # Ensure child process is reaped
+                    self._log("Waiting for mock process %d to exit...\n" % self._childpid)
+                    try:
+                        (pid, status) = os.waitpid(self._childpid, 0)
+                    except OSError, e:
+                        pass
+                    self._log("Mock process %d exited.\n" % self._childpid)
+                self._childpid = 0
+
+            # Start cleanup up the job
             self._start_cleanup()
+
         self._log("Killed.\n");
 
     def _log(self, string):




More information about the fedora-extras-commits mailing list