[Buildbot-commits] buildbot/buildbot/status builder.py,1.65,1.66

Brian Warner warner at users.sourceforge.net
Wed Aug 31 02:26:36 UTC 2005


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

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

replace the overwriting-old-LogFile assertion with a warning

	* buildbot/status/builder.py (LogFile): remove the assertion that
	blows up when you try to overwrite an existing logfile, instead
	just emit a warning. This case gets hit when the buildmaster is
	killed and doesn't get a chance to write out the serialized
	BuilderStatus object, so the .nextBuildNumber attribute gets out
	of date.


Index: builder.py
===================================================================
RCS file: /cvsroot/buildbot/buildbot/buildbot/status/builder.py,v
retrieving revision 1.65
retrieving revision 1.66
diff -u -d -r1.65 -r1.66
--- builder.py	31 Aug 2005 01:51:42 -0000	1.65
+++ builder.py	31 Aug 2005 02:26:34 -0000	1.66
@@ -228,8 +228,14 @@
         self.step = parent
         self.name = name
         self.filename = logfilename
-        assert not os.path.exists(self.getFilename())
-        self.openfile = open(self.getFilename(), "w+")
+        fn = self.getFilename()
+        if os.path.exists(fn):
+            # the buildmaster was probably stopped abruptly, before the
+            # BuilderStatus could be saved, so BuilderStatus.nextBuildNumber
+            # is out of date, and we're overlapping with earlier builds now.
+            # Warn about it, but then overwrite the old pickle file
+            log.msg("Warning: Overwriting old serialized Build at %s" % fn)
+        self.openfile = open(fn, "w+")
         self.runEntries = []
         self.watchers = []
         self.finishedWatchers = []





More information about the Commits mailing list