Export to GitHub

pylockfile - issue #10

lockfile on windows fail due to errno.EACCES


Posted on Dec 23, 2010 by Happy Camel

according to http://twistedmatrix.com/trac/browser/trunk/twisted/python/lockfile.py win32 mkdir may fail due to EACCES

Need handle it on acquire() like below snippet

            elif err.errno in (errno.EACCES, errno.EIO):
                time.sleep(wait)
                continue # retry

Comment #1

Posted on Dec 24, 2010 by Grumpy Lion

Thanks for the report. The documentation for the LinkLockFile class states:

"It need not exist, but its directory must exist and be writable at the time the acquire and release methods are called."

The same constraint holds for the MkdirLockFile class. I will make this clear in the documentation but will not change the implementation.

Comment #2

Posted on Dec 28, 2010 by Happy Camel

Sorry I didn't make it clear.

I use the module on Windows with multiprocessing running.

The lock mechanism failed at mkdirlockfile.py:58 # Couldn't create the lock for some other reason raise LockFailed("failed to create %s" % self.lock_file)

I check the error, it is os.errno.EACCES but didn't be caught.

Comment #3

Posted on Aug 21, 2013 by Quick Ox

+1. On Windows XP, acquire lock may eventually fail due to errno.EACCES when you have two or more processes trying to acquire lock.

Status: New

Labels:
Type-Defect Priority-Medium Component-Docs