rawhide report: 20081006 changes

James Antill james at fedoraproject.org
Wed Oct 8 16:44:35 UTC 2008


On Mon, 2008-10-06 at 11:41 -0700, Jesse Keating wrote:
> On Mon, 2008-10-06 at 20:33 +0200, Michael Schwendt wrote:
> > On Mon, 06 Oct 2008 10:19:46 -0700, Jesse Keating wrote:
> > 
> > > The yum folks are still looking into it.  The really bizarre thing is
> > > that there is no problem with the package itself, in fact it's seen in
> > > other arches, and in those other arch directories it's a hardlink back
> > > to the actual file somewhere else on the filesystem.  That's the way it
> > > is for each of those arch trees.  It's a real headscratcher of a
> > > problem.
> > 
> > Unless I'm misreading the code, it's a race-condition. mash creates the
> > metadata for all architectures in parallel. One process per arch. The
> > createrepo checksum cache file I/O [1] is not protected against concurrent
> > access. With odd timing, it can happen that one process reads an empty
> > checksum file that has just been opened for writing by another process.
> > Give it a try. Add a safety check after reading a checksum file.
> > 
> 
> That tickles a part of my brain, I think I speculated that this was the
> problem while in the shower or something, and then completely forgot to
> pursue it once I got ready to work.  It is a possibility.

 This should fix it:

http://koji.fedoraproject.org/koji/taskinfo?taskID=868762

...the patch being basically:

-            csumo = open(csumfile, 'w')
+
+            #  This is atomic cache creation via. rename, so we can have two
+            # tasks using the same cachedir ... mash does this.
+            csumo = tempfile.NamedTemporaryFile(mode='w', dir=self.crp_cachedir
             csumo.write(checksum)
             csumo.close()
+            os.rename(csumo.name, csumfile)


...it'll get upstream as soon as I can push :).

-- 
James Antill <james at fedoraproject.org>
Fedora




More information about the devel mailing list