sapling/eden/fs/cli
Thomas Orozco de525e8fe4 edenfsctl: take a lock around mutating config.json
Summary:
There is a race in here. We read the config, then mutate it, then put the new
config in place. However, if something else comes and mutates the config
between the time where we read it and write it again, we'll clobber its
changes.

Concretely, if you're running lots of `eden clone` or `eden rm` concurrently,
then the current mechanism will sometimes "forget" some directories or add back
directories you removed, which will e.g. break `eden list` (and cause those
commands to sometimes fail as well).

This diff fixes that by wrapping the critical section with a file lock.

Reviewed By: chadaustin, xavierd

Differential Revision: D32251727

fbshipit-source-id: 9eee57c7a824286bb4f0e7911e5ccd9d769c6daa
2021-11-11 00:50:32 -08:00
..
doctor suppress errors in fbcode/eden - batch 1 2021-08-24 14:30:57 -07:00
test add telemetry for eden prefetch 2021-09-23 09:37:03 -07:00
trace C++20 fixes 2021-11-03 17:55:42 -07:00
__init__.py remediation of S205607 2020-07-17 17:16:13 -07:00
buck.py cli: fix killing buck on Windows 2021-11-05 12:47:16 -07:00
CMakeLists.txt edenfsctl: take a lock around mutating config.json 2021-11-11 00:50:32 -08:00
cmd_util.py add helper command for deleting stale APFS volumes 2021-08-19 11:17:59 -07:00
config.py edenfsctl: take a lock around mutating config.json 2021-11-11 00:50:32 -08:00
configinterpolator.py cli: enable pyre-strict for configinterpolator.py 2021-05-19 19:27:06 -07:00
configutil.py suppress errors in fbcode/eden - batch 1 2021-10-19 19:09:59 -07:00
daemon_util.py win: add eden.exe to the package 2020-09-08 16:33:55 -07:00
daemon.py check for --privhelper_path when deciding whether to use sudo 2021-11-01 13:40:54 -07:00
debug_posix.py Changing eden/Eden/edenfs/Edenfs in the help and other user visible texts to EdenFS 2021-07-06 12:17:20 -07:00
debug_windows.py suppress errors in fbcode/eden - batch 1 2021-07-21 17:40:14 -07:00
debug.py fix thread safety issues in ActivityRecorder CLI 2021-08-30 19:30:08 -07:00
filesystem.py cli: enable pyre-strict for filesystem.py 2021-05-19 19:27:06 -07:00
fsck.py suppress errors in fbcode/eden - batch 1 2021-08-24 14:30:57 -07:00
hg_util.py suppress errors in eden - batch 1 2020-12-15 15:22:22 -08:00
logfile.py cli: enable pyre-strict for logfile.py 2021-05-19 19:27:07 -07:00
main.py config: remove overlay.enable_tree_overlay 2021-11-10 10:03:52 -08:00
mtab.py Move eden.cli namespace to eden.fs.cli 2020-03-25 11:46:56 -07:00
overlay.py windows: skip a some more integration tests on Windows 2021-11-10 13:23:26 -08:00
prefetch_profile.py return 0 if skipping predictive fetch 2021-08-25 12:39:55 -07:00
prefetch.py add telemetry for eden prefetch 2021-09-23 09:37:03 -07:00
prjfs.py cli: add debug state for checking projectedfs file state 2021-03-10 10:05:42 -08:00
proc_utils_win.py service: unify startup on Windows/Linux/macOS 2020-10-22 16:24:17 -07:00
proc_utils.py apply black 20.8b1 formatting update 2020-10-14 20:21:52 -07:00
rage.py rage: include the system mount table 2021-11-09 15:45:44 -08:00
redirect.py fix python type error take 2 2021-09-23 10:29:01 -07:00
stats_print.py remove stats memory command 2020-05-05 12:09:11 -07:00
stats.py pretty print rage sections and normalize underlining 2021-09-10 23:54:48 -07:00
subcmd.py suppress errors in fbcode/eden - batch 1 2021-08-24 14:30:57 -07:00
systemd_service.py Changing eden/Eden/edenfs/Edenfs in the help and other user visible texts to EdenFS 2021-07-06 12:17:20 -07:00
systemd.py apply black 20.8b1 formatting update 2020-10-14 20:21:52 -07:00
tabulate.py apply black 20.8b1 formatting update 2020-10-14 20:21:52 -07:00
telemetry.py add telemetry for eden prefetch 2021-09-23 09:37:03 -07:00
top.py make eden top xterm-color friendly 2021-10-08 09:43:02 -07:00
trace_cmd.py strace: add C++ implementation 2021-06-17 12:07:20 -07:00
trace.py Changing eden/Eden/edenfs/Edenfs in the help and other user visible texts to EdenFS 2021-07-06 12:17:20 -07:00
ui.py suppress errors in fbcode/eden - batch 1 2021-08-24 14:30:57 -07:00
util.py include kernel protocol in rage 2021-09-24 15:48:24 -07:00
version.py update edenfsctl to report the compile-time version 2020-04-22 12:48:48 -07:00
win_ui.py Move cli/ directory from eden/ to eden/fs (Without changing namespace) 2020-03-25 11:18:30 -07:00