Commit Graph

3 Commits

Author SHA1 Message Date
Durham Goode
c0688cc9d6 extutil: replace fcntllock with flock
The flock function supports windows and is cleaner. Let's delete the fcntllock
class and migrate consumers to the flock function.

Differential Revision: https://phab.mercurial-scm.org/D1567
2017-11-30 15:58:37 -08:00
Durham Goode
7deafbdc67 repack: move to fcntllock based locking
Previously repack use the standard Mercurial symlink based locking mechanism.
This caused problems on our laptop users because the symlink locking relies on
the host name and sometimes their hostname changes due to weird IT issues, which
resulted in locks existing forever and repack never running. The symlink based
locking scheme was also a problem in chroots, where two processes in different
chroots may attempt to repack the same shared cache at the same time.

Switching to a fcntllock based scheme will solve these issues.

Differential Revision: https://phab.mercurial-scm.org/D1543
2017-11-29 14:57:10 -08:00
Adam Simpkins
fdc2c3e6f9 extutil: add unit tests for runbgcommand
Summary:
Add some basic unit tests for extutil.runbgcommand().

This also changes the behavior to throw an OSError if we fail to execute the
process, instead of a subprocess.CalledProcessError.  This matches the behavior
of the subprocess module when it fails to execute the command.

Test Plan: Ran the tests.

Reviewers: stash, quark

Reviewed By: quark

Subscribers: net-systems-diffs@fb.com, yogeshwer, mjpieters

Differential Revision: https://phabricator.intern.facebook.com/D4864999

Signature: t1:4864999:1491874918:c03edafe02af217e41c28a770137bfd72bcbba9b
2017-04-11 11:25:40 -07:00