[Buildbot-commits] buildbot/buildbot/slave commands.py,1.34,1.35

Brian Warner warner at users.sourceforge.net
Tue May 17 22:19:21 UTC 2005


Update of /cvsroot/buildbot/buildbot/buildbot/slave
In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv6131/buildbot/slave

Modified Files:
	commands.py 
Log Message:
Revision: arch at buildbot.sf.net--2004/buildbot--dev--0--patch-195
Creator:  Brian Warner <warner at monolith.lothar.com>

don't explode when trying to interrupt non-existent Command

	* buildbot/slave/commands.py (ShellCommand.kill): if somehow this
	gets called when there isn't actually an active process, just end
	the Command instead of blowing up. I don't know how it gets into
	this state, but the twisted win32 buildslave will sometimes hang,
	and when it shakes its head and comes back, it thinks it's still
	running a Command. The next build causes this command to be
	interrupted, but the lack of self.process.pid breaks the interrupt
	attempt.


Index: commands.py
===================================================================
RCS file: /cvsroot/buildbot/buildbot/buildbot/slave/commands.py,v
retrieving revision 1.34
retrieving revision 1.35
diff -u -d -r1.34 -r1.35
--- commands.py	17 May 2005 10:14:11 -0000	1.34
+++ commands.py	17 May 2005 22:19:18 -0000	1.35
@@ -266,6 +266,14 @@
         self.kill(msg)
 
     def kill(self, msg):
+        if not self.process:
+            msg += ", but there is no current process, finishing anyway"
+            log.msg(msg)
+            self.sendStatus({'header': "\n" + msg + "\n"})
+            if self.pp:
+                self.pp.command = None
+            self.commandFailed(CommandInterrupted("no process to interrupt"))
+            return
         msg += ", killing pid %d" % self.process.pid
         log.msg(msg)
         self.sendStatus({'header': "\n" + msg + "\n"})





More information about the Commits mailing list