extras-buildsys/server BuildMaster.py,1.2,1.3
Daniel Williams (dcbw)
fedora-extras-commits at redhat.com
Sun Jun 19 03:06:03 UTC 2005
Author: dcbw
Update of /cvs/fedora/extras-buildsys/server
In directory cvs-int.fedora.redhat.com:/tmp/cvs-serv20898/server
Modified Files:
BuildMaster.py
Log Message:
Block all jobs from continuing if createrepo is being run, but if the repo is valid after the job acquires the lock, it still doesn't have to run createrepo.
Index: BuildMaster.py
===================================================================
RCS file: /cvs/fedora/extras-buildsys/server/BuildMaster.py,v
retrieving revision 1.2
retrieving revision 1.3
diff -u -r1.2 -r1.3
--- BuildMaster.py 19 Jun 2005 02:47:53 -0000 1.2
+++ BuildMaster.py 19 Jun 2005 03:05:50 -0000 1.3
@@ -74,22 +74,21 @@
return self.bcm
def createrepo(self, repodir):
- if not self._repo_invalid:
- return
-
""" We need to lock calls to createrepo so they don't get run at the same time """
# FIXME: possibly concurrency issue here, what if clients are
# trying to pull repodata while we are recreating it?
- if not os.path.exists(repodir):
- os.makedirs(repodir)
self.createrepo_lock.acquire()
- s, o = commands.getstatusoutput('/usr/bin/createrepo -q %s' % repodir)
- self.createrepo_lock.release()
- if s != 0:
- print "createrepo failed with exit status %d!" % s
+ if not os.path.exists(repodir):
+ os.makedirs(repodir)
+ if self._repo_invalid:
+ s, o = commands.getstatusoutput('/usr/bin/createrepo -q %s' % repodir)
+ if s != 0:
+ print "createrepo failed with exit status %d!" % s
self._repo_invalid = False
+ self.createrepo_lock.release()
+
def run(self):
while self.should_stop == False:
# Update all build clients and known jobs
More information about the scm-commits
mailing list