[Buildbot-commits] buildbot/buildbot/process step.py,1.78,1.79 base.py,1.60,1.61

Brian Warner warner at users.sourceforge.net
Sat Nov 26 02:14:33 UTC 2005


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

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

fix the multiple-equivalent-Lock-instances bug on config-file reload

	* buildbot/locks.py: fix the problem in which loading a master.cfg
	file that changes some Builders (but not all of them) can result
	in having multiple copies of the same Lock. Now, the real Locks
	are kept in a table inside the BotMaster, and the Builders/Steps
	use "LockIDs", which are still instances of MasterLock and
	SlaveLock. The real Locks are instances of the new RealMasterLock
	and RealSlaveLock classes.
	* buildbot/master.py (BotMaster.getLockByID): new method to
	convert LockIDs into real Locks.
	* buildbot/process/base.py (Build.startBuild): convert LockIDs
	into real Locks before building
	* buildbot/process/step.py (BuildStep.startStep): same
	* buildbot/test/test_locks.py (Locks.testLock1a): add a test which
	exercises the problem


Index: base.py
===================================================================
RCS file: /cvsroot/buildbot/buildbot/buildbot/process/base.py,v
retrieving revision 1.60
retrieving revision 1.61
diff -u -d -r1.60 -r1.61
--- base.py	14 Oct 2005 19:42:40 -0000	1.60
+++ base.py	26 Nov 2005 02:14:31 -0000	1.61
@@ -267,6 +267,10 @@
         self.build_status = build_status
         self.slavebuilder = slavebuilder
         self.slavename = slavebuilder.slave.slavename
+        # convert all locks into their real forms
+        self.locks = [self.builder.botmaster.getLockByID(l)
+                      for l in self.locks]
+        # then narrow SlaveLocks down to the right slave
         self.locks = [l.getLock(self.slavebuilder) for l in self.locks]
         self.remote = slavebuilder.remote
         self.remote.notifyOnDisconnect(self.lostRemote)

Index: step.py
===================================================================
RCS file: /cvsroot/buildbot/buildbot/buildbot/process/step.py,v
retrieving revision 1.78
retrieving revision 1.79
diff -u -d -r1.78 -r1.79
--- step.py	23 Nov 2005 08:01:21 -0000	1.78
+++ step.py	26 Nov 2005 02:14:31 -0000	1.79
@@ -472,8 +472,11 @@
 
         self.remote = remote
         self.deferred = defer.Deferred()
-        # convert all locks into their real form (SlaveLocks get narrowed
-        # down to the slave that this build is being run on)
+        # convert all locks into their real form
+        self.locks = [self.build.builder.botmaster.getLockByID(l)
+                      for l in self.locks]
+        # then narrow SlaveLocks down to the slave that this build is being
+        # run on
         self.locks = [l.getLock(self.build.slavebuilder) for l in self.locks]
         for l in self.locks:
             if l in self.build.locks:





More information about the Commits mailing list