Summary: These functions are part of the blocking API, which is being replaced by the Future-based API. They are not being called, so they are unneeded.
Reviewed By: chadaustin, strager
Differential Revision: D15582641
fbshipit-source-id: 11f693040124846515aef7c7ee6ad750e1b5c164
Summary: Developers should be encouraged to use Future-based functions instead of blocking functions in production code. Removing this blocking function makes it less convenient for developers to write blocking code in the future.
Reviewed By: strager
Differential Revision: D15564952
fbshipit-source-id: 3f62db472a59a6487ffe12e48c04178cad84ca61
Summary: The new Windows CMake targets were failing to include the generated thrift headers on Sandcastle machines. Making eden_service_thrift a dependecy will make sure that the thrift generated files are created before we compile the code.
Reviewed By: simpkins
Differential Revision: D15536743
fbshipit-source-id: 4bedb8f33cddf5f7eb8f5b5ce52b2013728b38f7
Summary: This is a stop gap solution to get the Windows build working with the getdeps, until we fix the SDK.
Reviewed By: chadaustin
Differential Revision: D15536740
fbshipit-source-id: 77cc6ea80c304a6cfcd0180bb28f63ce4dac2988
Summary: CompilerSettingsUnix adds /Wextra and other compiler flags which will error when building with Visual studio.
Reviewed By: chadaustin
Differential Revision: D15536742
fbshipit-source-id: af842f6ad50833f29fbfb602cdf793d0c4de11a9
Summary:
test_reading_committed_file_bumps_read_counter is flaky with optimized builds of edenfs. I think it's flaky because FuseChannel bumps counters *after* responding to the kernel, so the test can call get_counters before the counters are bumped.
Fix the flakiness by making the test wait a while for the counters to change.
Reviewed By: chadaustin
Differential Revision: D15550972
fbshipit-source-id: 891e5d0a9748b43eb0ef1089ef6bc0a547c47d4d
Summary:
In the past few months, test_no_units_are_active started failing. It looks like 'systemctl list-units' is now listing devices. For example:
```
$ systemctl list-units --all --full --no-pager
UNIT LOAD ACTIVE SUB JOB DESCRIPTION
● boot.automount not-found inactive dead boot.automount
proc-sys-fs-binfmt_misc.automount loaded active running Arbitrary Executable File Formats File System Automount Point
dev-disk-by\x2dlabel-\x5cx2f.device loaded active plugged /dev/disk/by-label/\x2f
[snip]
dev-getty.device loaded inactive dead /dev/getty
dev-loop0.device loaded active plugged /dev/loop0
dev-ram0.device loaded active plugged /dev/ram0
dev-ram1.device loaded active plugged /dev/ram1
[snip]
```
I don't know if systemctl changed or if systemd changed or if my machine's configuration changed. Either way, the test is failing now due to these systemd units.
Teach test_no_units_are_active to ignore these unimportant device units, since they don't represent running services or timers. This causes the test to pass on my machine.
Reviewed By: wez
Differential Revision: D15548072
fbshipit-source-id: 4f49c72d88b836aba37ec5ea7b5ee5b7cb8172f6
Summary:
EdenFS' systemd tests detect if the running system is managed by systemd, and chooses different strategies for creating a sandboxed systemd user manager depending on this detection. Sandcastle (Facebook's continuous integration system) recently started running systemd as the container's init system.
EdenFS' systemd tests correctly detect that Sandcastle's container is managed by systemd. Unfortunately, the tests cannot communicate with systemd. For example, `XDG_RUNTIME_DIR=/run systemctl --user status` in a Sandcastle job reports the following error:
> Failed to connect to bus: No data available
This error happens because systemd and the EdenFS' tests are running in a different process namespace. The filesystem shows that the system is managed by systemd, but the process table shows otherwise! This causes all of EdenFS' systemd tests to fail.
Work around this issue making Sandcastle use the old "unmanaged" code path. (The unmanaged code path is run if the system is not managed by systemd. Before Sandcastle started running systemd in its container, Sandcastle used this code path when running EdenFS's tests.)
(Ideally we would figure out why we need both the "managed" code path in the first place. This diff is just meant to fix tests on Sandcastle for now, not implement a long-term solution.)
Possibly related upstream systemd issue: https://github.com/systemd/systemd/issues/11300
Reviewed By: wez
Differential Revision: D15530685
fbshipit-source-id: b65b568e660310c50a4e25e0aa143f9388f1ad45
Summary:
Update EdenServer to use the new PeriodicTask class for flushing thread local
stats and collecting memory usage stats.
Reviewed By: strager
Differential Revision: D15492169
fbshipit-source-id: 41c23630ffe2f8365a0234a252821d07d48c8b29
Summary:
Add a new class for running periodic tasks on the main EventBase thread.
We already have several tasks that we run periodically:
- Flushing thread local stats (every 1s)
- Reporting memory stats (every 30s)
- Unloading unused inodes (configurable, but disabled by default)
I plan to add some new periodic tasks soon:
- Report LocalStore stats and perform garbage collection if needed
- Check if the config files have been updated and need to be re-read
This new class should make it easier to add periodic tasks with configurable
intervals, and make the intervals at which they run controllable from the
configuration file.
Reviewed By: strager
Differential Revision: D15492165
fbshipit-source-id: c1d2663da3c08851b60ba64d7a1e38ccca709b8a
Summary:
This diff teach Eden's Python client to use Windows' Unix Domain Socket support to connect to Eden.
#delayed_publish
Reviewed By: chadaustin
Differential Revision: D15454514
fbshipit-source-id: 86aa39f8aa13ae789efabda3fa88635f471a1a7a
Summary:
Some threads update FUSE counters, some threads update HgBackingStore counters, and some threads update HgImporter counters. No thread updates all of FUSE counters, HgBackingStore counters, and HgImporter counters. FUSE threads and HgImporter threads allocate the full set of counters (EdenThreadStats), even though many of the allocated counters can never be used during the thread's lifetime.
Reduce redundant allocation (and overhead during counter aggregation): split EdenThreadStats into three classes (FuseThreadStats, HgBackingStoreThreadStats, and HgImporterThreadStats) so different threads can allocate different sets of counters.
This diff should not change observable behavior.
Reviewed By: simpkins
Differential Revision: D14822273
fbshipit-source-id: cfd238187d20a0b8d3959673401ecad894e2095b
Summary: This diff pushes service resolution down to the `CurlClient` so that when a host is gone it can avoid sending more requests to a dead server.
Reviewed By: strager
Differential Revision: D15385384
fbshipit-source-id: a47e80f796dcd93d662750e3426abcb7cfb79607
Summary: Enable rocket server for services that switch to rocket/rsocket transport *in the future*. This diff should be a no-op for existing services that take rocket/rsocket traffic.
Reviewed By: yfeldblum
Differential Revision: D15511722
fbshipit-source-id: e2ba1ed9a32c18eca68b5d06722edbf029244f05
Summary:
Add a helper class for creating an EdenServer in a unit test.
Most of our existing unit tests only create EdenMount objects, without a full
EdenServer. This new class will make it easier to write tests for
functionality that does require a full EdenServer object.
Reviewed By: chadaustin
Differential Revision: D15492166
fbshipit-source-id: f8b1ce3b78a1160a5d55d305e6bf4b5305cca509
Summary:
In dev builds I have seen the `DaemonStartupLoggerTest.crashWithNoResult()`
test sometimes fail with the message
`edenfs is still running but did not report its initialization status`
instead of the expected error `edenfs crashed with signal 9`.
It appears that when killing the child process with `SIGKILL` we can see the
pipe close before the child is actually waitable. Update the `StartupLogger`
code to sleep briefly and retry the wait a few times before giving up in this
case. This allows us to determine the child's exit status correctly in this
situation.
Reviewed By: wez
Differential Revision: D15507309
fbshipit-source-id: 1f169c3061d1b2bd4154849c5dc7249e8f8c8e0c
Summary:
test_when_differently_configured_edenfs_processes_running_with_rogue_pids and some other tests are flaky on Linux if $TMPDIR is on tmpfs. This is because `os.listdir` returns entries in an arbitrary order on tmpfs filesystems. The flaky tests assume that `os.listdir("/proc")` (with a fake /proc filesystem that actually lives in $TMPDIR) returns process IDs in numerical order.
Fix the flakiness in the tests: Make the order of process IDs consistent by sorting them explicitly.
Reviewed By: wez
Differential Revision: D15504651
fbshipit-source-id: fa99653bfd2cb076c2721cf547a44bf6612e646d
Summary:
I am refactoring edenfs' EdenStats class. In doing so, I accidentally removed a call to `aggregate`, causing `flushStatsNow` to not expose accurate counters. This wasn't caught by any existing tests, only by manual testing.
Add some tests to prevent FUSE and HgBackingStore statistics collection from completely regressing.
Reviewed By: simpkins
Differential Revision: D15274275
fbshipit-source-id: c8a9c9848dd60aee7f252a93f10ddce6d7560799
Summary:
In another diff, Adam Simpkins noticed that HgImporterStatsTest.get_counters was clunky and that the logic belongs in the EdenTestCase base class.
Hoist HgImporterStatsTest.get_counters into EdenTestCase. Also avoid reusing the Thrift client between calls to get_counters because edenfs might restart between calls (in which case the old Thrift client won't work).
Reviewed By: wez
Differential Revision: D15514537
fbshipit-source-id: 0ae25106baa0e5b2d857b0bb2552d884b9b270ef
Summary: Some pyre-fixme directives are on the wrong line. Move them to the line to fix "Unused ignore" errors from Pyre.
Reviewed By: wez
Differential Revision: D15507418
fbshipit-source-id: b8d1163080b1c64868c37e7581411be31f495141
Summary:
Update `eden start` to treat the `--gdb` argument like `--foreground`, and
always start in non-systemd mode, even if this would be the default otherwise.
The `--gdb` flag automatically implies `--foreground`
Reviewed By: wez
Differential Revision: D15492158
fbshipit-source-id: 89d65f7aef8c31131c7d95e054995df8a138cc41
Summary:
Read information from the machine-readable `/proc/self/statm` rather than
attempting to parse the human-readable `/proc/self/status` file.
This simplifies the parsing logic overall.
Reviewed By: wez
Differential Revision: D15466907
fbshipit-source-id: c0184b0faa0a18cf0101828c3822b546ca7a677e
Summary:
HgBackingStore has two constructors. The constructor used in production code accepts an EdenStats object, but the constructor used in test code does not. This means that `HgBackingStore::stats_` could be null, thus tracking statistics in HgBackingStore is more work than it should be.
Make HgBackingStore require an EdenStats object so `HgBackingStore::stats_` is never null.
In production code, this diff should not change behavior.
Reviewed By: simpkins
Differential Revision: D15256266
fbshipit-source-id: f74137bed3e83e1b82d68b840fa55f3a3f0bf0cc
Summary: This function isn't used anywhere. Delete it.
Reviewed By: pkaush
Differential Revision: D9695388
fbshipit-source-id: 1ac702c98ee63d09c15c8a7b8a9c8d44fcec630d
Summary:
`HgBackingStore::getBlob` calls `HgImporter::importFileContents` in two different branches. The calls are identical, and have an identical comment explaining the use of `folly::SemiFuture::via`. This duplication makes it annoying to add instrumentation and other changes.
Factor each call into a new `HgBackingStore::getBlobFromHgImporter` function, deduplicating the code.
This diff should not change behavior.
Reviewed By: simpkins
Differential Revision: D15256267
fbshipit-source-id: cad0566e9dab15775ee0d711e452f3e60fa6e645