[Buildbot-commits] buildbot/buildbot/scripts runner.py,1.25,1.26

Brian Warner warner at users.sourceforge.net
Wed May 18 02:21:32 UTC 2005


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

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

'buildbot stop': don't double-kill the daemon

	* buildbot/scripts/runner.py (stop): actually poll once per
	second, instead of re-killing the poor daemon once per second.
	Sleep briefly (0.1s) before the first poll, since there's a good
	chance we can avoid waiting the full second if the daemon shuts
	down quickly. Also remove the sys.exit() at the end.
	(start): remove the unneighborly sys.exit()


Index: runner.py
===================================================================
RCS file: /cvsroot/buildbot/buildbot/buildbot/scripts/runner.py,v
retrieving revision 1.25
retrieving revision 1.26
diff -u -d -r1.25 -r1.26
--- runner.py	18 May 2005 01:59:54 -0000	1.25
+++ runner.py	18 May 2005 02:21:29 -0000	1.26
@@ -334,7 +334,6 @@
             from twisted.scripts.twistd import run
         run()
 
-    sys.exit(0)
 
 def stop(config, signame="TERM"):
     import signal
@@ -346,17 +345,17 @@
     signum = getattr(signal, "SIG"+signame)
     timer = 0
     os.kill(pid, signum)
+    time.sleep(0.1)
     while timer < 5:
         # poll once per second until twistd.pid goes away, up to 5 seconds
         try:
-            os.kill(pid, signum)
+            os.kill(pid, 0)
         except OSError:
             print "buildbot process %d is dead" % pid
             sys.exit(0)
         timer += 1
         time.sleep(1)
     print "never saw process go away"
-    sys.exit(0)
 
 def loadOptions(filename="options", here=None, home=None):
     """Find the .buildbot/FILENAME file. Crawl from the current directory up





More information about the Commits mailing list