eups icon indicating copy to clipboard operation
eups copied to clipboard

lockdir race condition

Open joezuntz opened this issue 9 years ago • 3 comments

Hi.

There appears to be some kind of race condition in the eups-setup system. Multiple processes trying to setup at the same time will sometimes fail.

Here's the easiest way I have found to trigger it:

import os
import multiprocessing

def task(i):
    return os.system("source /home/zuntz/lsst/anaconda/bin/eups-setups.sh")

pool = multiprocessing.Pool(32)
args = range(100)
print pool.map(task, args)

I (usually) get a combination of:

OSError: [Errno 2] No such file or directory: '/home/zuntz/lsst/anaconda/var/opt/eups/.lockDir'

and some atexit errors trying to remove the same file when it doesn't exist.

Interestingly, there seems to be a similar bug in conda: https://github.com/conda/conda/issues/2837

Cheers! Joe

joezuntz avatar Aug 30 '16 15:08 joezuntz

The locking in eups is sub-optimal, so we usually disable it. Put in your $EUPS_PATH/site/startup.py:

# Disable locking
hooks.config.site.lockDirectoryBase = None

PaulPrice avatar Aug 30 '16 17:08 PaulPrice

Given all the known issues with locking, should we just make this the default (ping @RobertLuptonTheGood)?

mjuric avatar Aug 30 '16 23:08 mjuric

Thanks - that fixed my problem!

joezuntz avatar Aug 31 '16 07:08 joezuntz