← Back to team overview

launchpad-reviewers team mailing list archive

[Merge] lp:~jelmer/launchpad-buildd/early-build-abort into lp:launchpad-buildd

 

Jelmer Vernooij has proposed merging lp:~jelmer/launchpad-buildd/early-build-abort into lp:launchpad-buildd.

Requested reviews:
  Launchpad code reviewers (launchpad-reviewers)
Related bugs:
  Bug #497772 in Launchpad Auto Build System: "exceptions.AttributeError: 'DebianBuildManager' object has no attribute '_subprocess'"
  https://bugs.launchpad.net/launchpad-buildd/+bug/497772

For more details, see:
https://code.launchpad.net/~jelmer/launchpad-buildd/early-build-abort/+merge/86625

Prevent a slave from blowing up when it is aborted before a job has started.
-- 
https://code.launchpad.net/~jelmer/launchpad-buildd/early-build-abort/+merge/86625
Your team Launchpad code reviewers is requested to review the proposed merge of lp:~jelmer/launchpad-buildd/early-build-abort into lp:launchpad-buildd.
=== modified file 'debian/changelog'
--- debian/changelog	2011-12-08 22:13:03 +0000
+++ debian/changelog	2011-12-21 21:43:46 +0000
@@ -9,6 +9,7 @@
   [ Jelmer Vernooij ]
   * Use the actual target distroseries name in changelog, rather than
     the same as the last entry. LP: #855479
+<<<<<<< TREE
   * Use os.SEEK_END constant now that all build slaves run at least
     hardy. LP: #239213
 
@@ -25,6 +26,12 @@
   * Log `uname -a` as well.
 
  -- William Grant <wgrant@xxxxxxxxxx>  Mon, 05 Dec 2011 15:01:43 +1100
+=======
+  * Prevent slave from blowing up when it is aborted before a job has
+    started. LP: #497772
+
+ -- Jelmer Vernooij <jelmer@xxxxxxxxxx>  Tue, 29 Nov 2011 13:49:29 +0100
+>>>>>>> MERGE-SOURCE
 
 launchpad-buildd (109) hardy; urgency=low
 

=== modified file 'lpbuildd/slave.py'
--- lpbuildd/slave.py	2011-12-05 02:39:05 +0000
+++ lpbuildd/slave.py	2011-12-21 21:43:46 +0000
@@ -179,21 +179,22 @@
         """Abort the build by killing the subprocess."""
         if not self.alreadyfailed:
             self.alreadyfailed = True
-        # Either SIGKILL and SIGTERM presents the same behavior,
-        # the process is just killed some time after the signal was sent
-        # 10 s ~ 40 s, and returns None as exit_code, instead of the normal
-        # interger. See further info on DebianBuildermanager.iterate in
-        # debian.py
-        # XXX cprov 2005-09-02:
-        # we may want to follow the canonical.tachandler kill process style,
-        # which sends SIGTERM to the process wait a given timeout and if was
-        # not killed sends a SIGKILL. IMO it only would be worth if we found
-        # different behaviour than the previous described.
-        self._subprocess.transport.signalProcess('TERM')
-        # alternativelly to simply send SIGTERM, we can pend a request to
-        # send SIGKILL to the process if nothing happened in 10 seconds
-        # see base class process
-        self._subprocess.killCall = reactor.callLater(10, self.kill)
+        if self._subprocess is not None:
+            # Either SIGKILL and SIGTERM presents the same behavior, the
+            # process is just killed some time after the signal was sent 
+            # 10 s ~ 40 s, and returns None as exit_code, instead of the normal
+            # integer. See further info on DebianBuildermanager.iterate in
+            # debian.py
+            # XXX cprov 2005-09-02:
+            # we may want to follow the canonical.tachandler kill process
+            # style, which sends SIGTERM to the process wait a given timeout
+            # and if was not killed sends a SIGKILL. IMO it only would be worth
+            # if we found different behaviour than the previous described.
+            self._subprocess.transport.signalProcess('TERM')
+            # alternatively to simply send SIGTERM, we can pend a request to
+            # send SIGKILL to the process if nothing happened in 10 seconds
+            # see base class process
+            self._subprocess.killCall = reactor.callLater(10, self.kill)
 
     def kill(self):
         """Send SIGKILL to child process


Follow ups