Commit Graph

2353 Commits

Author SHA1 Message Date
svcscm
9fd80b9f77 Updating submodules
Reviewed By: cdelahousse

fbshipit-source-id: 78da9883833816604d48521fba14d82b62783325
2019-06-03 23:35:12 -07:00
svcscm
b12561dcdb Updating submodules
Reviewed By: cdelahousse

fbshipit-source-id: 7c9684fdf3a784c088590377063b29fff44d0c8d
2019-06-03 05:25:38 -07:00
svcscm
b2d4a50c30 Updating submodules
Reviewed By: cdelahousse

fbshipit-source-id: 05b2dec2c79de762dfbc70879abd1d65924ef14c
2019-06-02 15:25:11 -07:00
svcscm
087ff36cbd Updating submodules
Reviewed By: cdelahousse

fbshipit-source-id: 5983a7bf21f8f326eaa259ff239fc6c9f2002ae4
2019-06-01 21:25:46 -07:00
svcscm
06e1490c1a Updating submodules
Reviewed By: cdelahousse

fbshipit-source-id: 1ef44be44460f740fd2c5da5c3513f8a818da340
2019-05-31 21:15:42 -07:00
Brian Strauch
e32b173a16 Deleted two unused blocking methods
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
2019-05-31 18:21:15 -07:00
Brian Strauch
5380c70c14 Removed getInodeBlocking and replaced with Future version
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
2019-05-31 18:21:15 -07:00
svcscm
1f4cd5eeab Updating submodules
Reviewed By: cdelahousse

fbshipit-source-id: 6cdaadc0e3e573e4f1edbfb749841607a32550fc
2019-05-31 17:21:20 -07:00
Puneet Kaushik
7913c918e2 Add eden_service_thrift as a dependency for the new CMake targets.
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
2019-05-31 16:16:23 -07:00
Puneet Kaushik
531154d281 Add FindPrjfs to locate Projected FS sdk.
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
2019-05-31 16:16:23 -07:00
Puneet Kaushik
9b8dac57e5 Remove CompilerSettingsUnix from Windows builds
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
2019-05-31 16:16:23 -07:00
Jake Crouch
5a59af8ae9 added JournalStats
Summary: Added JournalStats to start tracking basic stats on the Journal

Reviewed By: chadaustin

Differential Revision: D15565886

fbshipit-source-id: b7345df377303fc442ecf4c112afa7493bb2dc28
2019-05-31 14:40:10 -07:00
svcscm
e8daac0e33 Updating submodules
Reviewed By: cdelahousse

fbshipit-source-id: fc732eeae6492e83097fe9f04e72f71efbbc83f7
2019-05-31 14:40:09 -07:00
svcscm
e3074630ac Updating submodules
Reviewed By: cdelahousse

fbshipit-source-id: 6e46adf69b6c41139fb5937d9a429133bbc690b8
2019-05-30 20:07:45 -07:00
Matt Glazar
1ec3027f1e Fix flakiness in FUSE stats tests
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
2019-05-30 18:13:24 -07:00
Matt Glazar
db710ae045 Fix flaky systemd test_no_units_are_active test
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
2019-05-30 18:07:37 -07:00
Matt Glazar
b4620e01ca Fix systemd tests on Sandcastle
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
2019-05-30 18:02:39 -07:00
svcscm
e9a080078c Updating submodules
Reviewed By: cdelahousse

fbshipit-source-id: 618c29a0d185c50ed29c9554677a45ac28b35dda
2019-05-30 18:02:39 -07:00
svcscm
e66868f36d Updating submodules
Reviewed By: cdelahousse

fbshipit-source-id: f803465b8810d1de52b1312600ccef4b92c3032c
2019-05-30 15:53:19 -07:00
Adam Simpkins
a6c23b6c52 use PeriodicTask for EdenServer stats operations
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
2019-05-30 15:11:11 -07:00
Adam Simpkins
e6c07128a4 add a new PeriodicTask helper class
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
2019-05-30 15:11:11 -07:00
svcscm
51fbd14c3e Updating submodules
Reviewed By: cdelahousse

fbshipit-source-id: 19c7aa34142245ed8e0caf245fea8ec5e94ad554
2019-05-30 15:11:10 -07:00
svcscm
17cc40f1a5 Updating submodules
Reviewed By: cdelahousse

fbshipit-source-id: 80a731a1b8b04df01cb0d68ec39d4af10e0b61b7
2019-05-30 13:08:57 -07:00
Zeyi (Rice) Fan
d12aa11700 use unix domain socket on Windows
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
2019-05-30 11:32:05 -07:00
Matt Glazar
761d5d2c8e Separate FUSE and Hg counter structs
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
2019-05-29 18:11:56 -07:00
svcscm
5436028259 Updating submodules
Reviewed By: cdelahousse

fbshipit-source-id: af765acb032edbe24f9b777b17289114c1b29d06
2019-05-29 18:11:56 -07:00
svcscm
bade84fcf2 Updating submodules
Reviewed By: cdelahousse

fbshipit-source-id: e80baf12df66161b4cc9e63601427aa1cab2a7c6
2019-05-29 11:59:09 -07:00
Zeyi (Rice) Fan
602e1605b0 re-resolve host name when previous requests fail
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
2019-05-29 11:38:21 -07:00
svcscm
47b9872112 Updating submodules
Reviewed By: cdelahousse

fbshipit-source-id: cf8b6798a2b4b214bd5ff096d8286efbc1c80460
2019-05-29 11:38:21 -07:00
svcscm
f10edf0fe4 Updating submodules
Reviewed By: cdelahousse

fbshipit-source-id: b507922505288b4a855bd9eab830c50b39a6935b
2019-05-29 09:33:04 -07:00
Jon Maltiel Swenson
ed59cc451e Enable rocket server stack by default for future services that use rocket/rsocket transport
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
2019-05-29 09:08:00 -07:00
Yedidya Feldblum
0e620ade4d Cut D support from assorted .thrift files
Summary: Cut D support from assorted .thrift files.

Reviewed By: simpkins, markisaa, GirasoleY

Differential Revision: D15492500

fbshipit-source-id: 68c7fb4ff6c8917be0db961c7bdaa62a75f1b300
2019-05-29 02:32:16 -07:00
svcscm
9da4e9fa52 Updating submodules
Reviewed By: cdelahousse

fbshipit-source-id: e34d14b44c2717b1eb7d90802963d1a846d3ded1
2019-05-28 23:56:50 -07:00
Adam Simpkins
67cd4bbf45 add a TestServer class
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
2019-05-28 21:39:39 -07:00
Adam Simpkins
68b3bbba3c fix a flaky StartupLogger test
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
2019-05-28 21:39:39 -07:00
svcscm
fcd0b3279a Updating submodules
Reviewed By: cdelahousse

fbshipit-source-id: cdb44b8de504d5a874aaa7457030244ea950c2d5
2019-05-28 21:39:39 -07:00
svcscm
341f49aff1 Updating submodules
Reviewed By: cdelahousse

fbshipit-source-id: c7c9c961e7725ddc06fbd498845fbd14a7585ddb
2019-05-28 17:06:41 -07:00
Matt Glazar
9afc63041f Fix FakeProcessFinder flakiness on tmpfs
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
2019-05-28 15:43:19 -07:00
Matt Glazar
1775680391 Test FUSE and HgBackingStore stat collection
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
2019-05-28 15:43:19 -07:00
Matt Glazar
9e6a39e951 Factor duplicate code into EdenTestCase.get_counters
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
2019-05-28 15:43:18 -07:00
Matt Glazar
1cf18f6e56 Fix misplaced pyre-fixme directives
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
2019-05-28 15:37:38 -07:00
svcscm
a9ca486c57 Updating submodules
Reviewed By: cdelahousse

fbshipit-source-id: 23ed059bc8aa5ca054eddc56f843b3e3e840f4ee
2019-05-28 15:23:54 -07:00
Adam Simpkins
df044b9286 make eden start --gdb work even when systemd is the default
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
2019-05-28 12:55:41 -07:00
Adam Simpkins
4b9f8a55f9 read memory stats from /proc/self/statm instead of /proc/self/status
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
2019-05-28 12:55:41 -07:00
svcscm
8e338d311c Updating submodules
Reviewed By: cdelahousse

fbshipit-source-id: f6a2b8b18c5134d524aff0f143537e64c539461a
2019-05-28 12:17:38 -07:00
Matt Glazar
7617100f16 Fix potential null dereference in HgBackingStore tests
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
2019-05-27 22:39:47 -07:00
Matt Glazar
ef5a29b32a Delete dead code
Summary: This function isn't used anywhere. Delete it.

Reviewed By: pkaush

Differential Revision: D9695388

fbshipit-source-id: 1ac702c98ee63d09c15c8a7b8a9c8d44fcec630d
2019-05-27 22:35:29 -07:00
Matt Glazar
abc4d31e2d Factor duplicate importFileContents call in getBlob
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
2019-05-27 21:54:44 -07:00
svcscm
acea2fdd21 Updating submodules
Reviewed By: cdelahousse

fbshipit-source-id: 9888f8fc0a43c7e7236c362549bb8a8056ce17cd
2019-05-27 21:54:44 -07:00
svcscm
a492a10b29 Updating submodules
Reviewed By: cdelahousse

fbshipit-source-id: 7923a83955279e90e6203bdf0360254595c93cc3
2019-05-27 13:56:18 -07:00