Looking at the code, this looks like a race condition to me:

    # Create the database directory if missing
    if not os.path.isdir(XAPIANDBPATH):
        progress.verbose("Creating the database directory at %s" % XAPIANDBPATH)
        os.mkdir(XAPIANDBPATH)

    # Lock the session so that we prevent concurrent updates
    lockfd = os.open(XAPIANDBLOCK, os.O_RDWR | os.O_CREAT)
    lockpyfd = os.fdopen(lockfd)

The indexer hasn't taken out a lock when it tries to ensure the directory is
there (the lock is created in XAPIANDBPATH + "/update-lock", so it can't)
and one process could create XAPIANDBPATH between another checking if it
exists and trying to create it.

I'd suggest checking if mkdir() fails with EEXIST and in that case to check
again if XAPIANDBPATH is a directory and if it is to continue (or exit cleanly
since another process is just starting to try indexing anyway).  Not sure how
to code that in Python off the top of my head though...

Cheers,
    Olly



-- 
To UNSUBSCRIBE, email to debian-bugs-dist-requ...@lists.debian.org
with a subject of "unsubscribe". Trouble? Contact listmas...@lists.debian.org

Reply via email to