mirror of
https://github.com/facebook/sapling.git
synced 2024-10-13 02:07:31 +03:00
9740116626
Summary: We recently ran into issues with locks in pid namespaces [1]. Let's fix that by using flock. flock is more reliable in Linux's pid namespace use-case than file-existence test, because it works without a /proc filesystem and does not have deadlock issue if an hg process is killed unexpectedly (ex. OOM or SIGKILL). The transition should be transparent: - If the new code saw a symlink lock file generated by the old code. `open(..., O_NOFOLLOW)` will fail and it's considered lock taken by the old process correctly. - If the old code saw a new lock file. It will treat it as system without symlink support and it's considered lock taken by the new process correctly. A non-symlink stale lock (regardless of whether it contains pid information or not) will be confidently removed automatically by the new code. The change is complicated because it works when both new and old hg run at the same time. If we have migrated most users to the new code path, the code can be cleaned up significantly. [1]: https://fburl.com/85fxjisi Reviewed By: DurhamG Differential Revision: D9004614 fbshipit-source-id: d501c4f3a7bc8ad73c9556be1c6a265ffd0d0686 |
||
---|---|---|
.. | ||
__init__.py | ||
cachemanager.py | ||
concurrency.py | ||
constants.py | ||
debug.py | ||
implementation.py | ||
metrics.py |