-
- Downloads
Use a single lock file for stages and a single file for prefixes.
- Locks now use fcntl range locks on a single file. How it works for prefixes: - Each lock is a byte range lock on the nth byte of a file. - The lock file is ``spack.installed_db.prefix_lock`` -- the DB tells us what to call it and it lives alongside the install DB. n is the sys.maxsize-bit prefix of the DAG hash. For stages, we take the sha1 of the stage name and use that to select a byte to lock. With 100 concurrent builds, the likelihood of a false lock collision is ~5.36e-16, so this scheme should retain more than sufficient paralellism (with no chance of false negatives), and get us reader-writer lock semantics with a single file, so no need to clean up lots of lock files.
Showing
- lib/spack/spack/database.py 3 additions, 0 deletionslib/spack/spack/database.py
- lib/spack/spack/package.py 21 additions, 4 deletionslib/spack/spack/package.py
- lib/spack/spack/spec.py 2 additions, 11 deletionslib/spack/spack/spec.py
- lib/spack/spack/stage.py 17 additions, 3 deletionslib/spack/spack/stage.py
- lib/spack/spack/util/crypto.py 14 additions, 0 deletionslib/spack/spack/util/crypto.py
Loading
Please register or sign in to comment