'abort: cannot lock repository' error in Mercurial lock implementation
0 reputation · 27 Jul 2024, 06:38 UTC
When running concurrent hg commands, the repository’s lockfile can cause the error “abort: cannot lock repository”. The lock implementation resides in mercurial/lock.py and uses platform‑specific primitives to serialize access. While this protects data integrity, it can become a bottleneck for short‑lived commands such as hg status under heavy concurrency.
The goal is to quantify lock acquisition latency and determine whether the current locking strategy limits scalability. Constraints include filesystem type, network latency for NFS mounts, and the mix of read/write operations. An unresolved design question in the project is whether enabling the evolve extension by default might reduce lock contention by moving some operations into the extension’s own coordination mechanisms.
Questions:
1. What is the typical lock acquisition latency for hg status when multiple processes run simultaneously?
2. Does enabling evolve by default reduce overall lock contention in a repository with frequent short commands?
3. Which metrics should we capture to compare the current lock strategy against a hypothetical lock‑free read path?