Commit Graph

1493 Commits

Author SHA1 Message Date
Lee Howes
a759b25b7d Future<T>::then Future<T>::then() -> Future<T>::thenValue or thenTry.
Summary:
Part of the larger project to modify Future<T>::then to be r-value qualified and use Future<T>::thenTry or Future<T>::thenValue.

The goal is to disambiguate folly::Future and to improve type and lifetime safety of Future and its methods.

Codemod:
  future<T>.then(callable with operator()(not-a-try)) to future<T>.thenValue(callable with operator()(not-a-try)).
  future<T>.then(callable with operator()()) to future<T>.thenValue(callable with operator()(auto&&)).
  future<T>.then(callable with operator()(auto)) to future<T>.thenValue(callable with operator()(auto)).
  future<T>.then(callable with operator()(folly::Try<T>)) to future<T>.thenTry(callable)

Reviewed By: Orvid

Differential Revision: D10227086

fbshipit-source-id: 1bb31c91cc65e28291e39302627f97801bfde15c
2018-10-07 17:06:49 -07:00
Chad Austin
dbb793becf Don't crash when handling FUSE requests from own edenfs
Summary:
Aborting the process with self-access is overlay aggressive. We
already respond with EIO, and the calling syscall should handle the
error. Continue logging at CRITICAL.

Reviewed By: wez

Differential Revision: D10134987

fbshipit-source-id: a4c4eed5e5de20698e95f442b3e063a09db311e6
2018-10-02 10:07:38 -07:00
Chad Austin
88b08e5b00 clang-format
Summary: We've diverged in a few places from clang-format, so run it across the entirety of Eden.

Reviewed By: wez

Differential Revision: D10137785

fbshipit-source-id: 9603c2eeddc7472c33041ae60e3e280065095eb7
2018-10-02 10:07:38 -07:00
Chad Austin
f23902ae6f To avoid self-access deadlocks, at least respond to FUSE before aborting
Summary:
If an edenfs thread accesses an Eden mount, it trips SIGABRT from the
DFATAL, but the SIGABRT can't end the process because one thread is
stuck in uninterruptible sleep. So respond to the FUSE request before
aborting the process.

Reviewed By: strager

Differential Revision: D10118625

fbshipit-source-id: b84063e0b186d6a464531284b70c25b0b6a710ce
2018-10-01 14:37:23 -07:00
Wez Furlong
36608c7820 explicitly complete StreamPublisher stream on destruct
Summary:
When running the watchman integration tests, I saw that some of them were
fataling here:

diffusion/FBS/browse/master/fbcode/thrift/lib/cpp2/async/StreamPublisher-inl.h$71

In this situation we're tearing down all the subscribers via
`Journal::cancelAllSubscribers` and this causes the stream be destroyed and
trigger this FATAL check.

We need to explicitly complete it before we can proceeed, so we do the gross
thing and call this in the destructor of a little wrapper.

This is made a little more complex because the disconnection handler has to
inform the Journal that it was torn down in the case where the client has
gone away.  The result is that we need to be careful to avoid the destructor
on Journal callback from running while we hold the Journal subscriber lock.

Reviewed By: strager

Differential Revision: D10024271

fbshipit-source-id: 06a9d40f7f6e46fe35ffcedba2669e27e6624427
2018-10-01 13:21:59 -07:00
Zsolt Dollenstein
8aee87fd50 Format with black 18.9b0
Summary: Reformat all opted-in python code with version `18.9b0` of Black.

Reviewed By: ambv

Differential Revision: D10121017

fbshipit-source-id: 08404dba959bc63bcd7eee7eafe1753c9cfb58ee
2018-10-01 08:06:47 -07:00
Chad Austin
598b471442 Disable automatic background unloading until we've fixed the InodeMap crash
Summary:
In D6766900, we turned on automatic background inode
unloading. However, there's a bug somewhere in InodeMap or the loading
sequence that causes occasional crashes for users, so turn it back off
for now.

Reviewed By: pkaush

Differential Revision: D10114443

fbshipit-source-id: fd35fd31b5731aa9bf26004fca8aa73930bb2344
2018-09-28 16:51:32 -07:00
Puneet Kaushik
313fbbe0f9 Win: Restructured the Windows code to align with the eden code layout
Summary:
Restructured the Windows code to align with the eden code layout. Plus changed the build location to eden/win/build directory, which is generated by the Windows build script.
  eden
    \_fs
    \_ ...
    \_ win
        \_fs
           \_service
           \_utils
        \_build (generated by the build script)

Reviewed By: strager

Differential Revision: D10081143

fbshipit-source-id: db9fb25f963d1a9cccb8a8f83646e7e45c87d409
2018-09-28 13:14:11 -07:00
Puneet Kaushik
389615ee2b Win: Fixing windows build
Summary: Taking (#ifdef'ing) out some of the mononoke code from the Windows builds. Mononoke support will come once we compile the proxygen on Windows.

Reviewed By: strager

Differential Revision: D10079379

fbshipit-source-id: df431f9c57832d43811af41d4512674f1108cacf
2018-09-28 10:06:36 -07:00
Chad Austin
1100e0fb57 collect edenfs process tree including importers in eden rage
Summary:
I noticed that, when Eden hangs, an importer is usually stuck for a
long time too. Add information about edenfs's child processes in
`eden rage`.

Reviewed By: strager

Differential Revision: D10020317

fbshipit-source-id: afe82f559ea0905f10c757fc0b05c3ff64f5ab41
2018-09-26 16:36:36 -07:00
Matt Glazar
30a6e268c6 Set time limit for fuzz tests
Summary: HypothesisSimpleTest.test_create is timing out on Sandcastle (Facebook's CI). It looks like the hypothesis tests run indefinitely on Sandcastle. Set a time limit so the tests complete and provide signal.

Reviewed By: wez

Differential Revision: D10053452

fbshipit-source-id: 8c8cb2c375a73b7727e827ea2a9e7d56ab390e54
2018-09-26 13:23:03 -07:00
Matt Glazar
362e567f68 Add some 'eden stop' tests
Summary:
'eden stop' has poor test coverage. Write tests for the common case and some edge cases which 'eden stop' already handles.

This diff should not change behavior.

Reviewed By: wez

Differential Revision: D10017819

fbshipit-source-id: 4d9f5db52187c34c62a9379a6b3dd62f62894233
2018-09-26 13:23:03 -07:00
Chad Austin
3ac3738140 stop prefetching blobs on every open()
Summary:
When a file's contents are not cached by the kernel, open(), read(),
and close() are all piped into the FUSE daemon. But when a file's
contents ARE cached by the kernel, only open() and close() are. Thus,
in the common case, the kernel will notify us that a file is being
opened, but read() will be served out of cache.

In that case, prefetching the blob is not beneficial, because it will
be dropped anyway upon close().

In situations where the VFS cache is hot but eden's own caches are
cold, this is probably a win.

Reviewed By: strager

Differential Revision: D10044546

fbshipit-source-id: eeb0854dbff021b2c73f1a42f31a94dd9fcf0837
2018-09-26 11:39:56 -07:00
Chad Austin
bf8970752d despam periodic unload log and make it useful
Summary:
Previously, Eden would log `UnloadInodeScheduler Unloading Free
Inodes` every 10 minutes. Now it only logs if it actually unloads an
inode for a mount.

Reviewed By: strager

Differential Revision: D9999029

fbshipit-source-id: f01d0e7b1341bef230bcb5a327c31ffc8e3aeb2c
2018-09-25 17:51:41 -07:00
Chad Austin
ecdd694732 add a script to measure minimum and average open() and close() syscall latency
Summary:
We're looking into doing some performance optimizations in Eden to the
open() and close() calls, since they are never handled by the kernel
and always pass through to the underlying user-space FUSE daemon. But
first, let's capture some baseline numbers on Eden and non-Eden
checkouts.

Reviewed By: strager

Differential Revision: D10036941

fbshipit-source-id: 64f3414a4572fd963017491db37d70e6b5ae4f24
2018-09-25 17:36:46 -07:00
Chad Austin
62a2682487 test that inodes can be unloaded while they're loading
Summary:
My eden crashed with an invariant violation in InodeMap. It looks
related to background unloading, so I attempted to reproduce the
sequence in a unit test.

These tests pass but they're worth checking in I think.

Reviewed By: strager

Differential Revision: D9998970

fbshipit-source-id: d182fc8d5b185c286082320adda3ea4c862f2f18
2018-09-25 17:36:46 -07:00
Dan Schatzberg
3e0170774c Move datapack loads to HgBackingStore
Summary:
There's a lot of logic here that need not be offloaded to the
importer threads

Reviewed By: chadaustin

Differential Revision: D9539811

fbshipit-source-id: 1379eef390df6400291a61263d003b493a474b81
2018-09-25 11:21:51 -07:00
Chad Austin
d45636ee81 remove InodeMap::lookupUnloadedInode
Summary: This function is never used.

Reviewed By: strager

Differential Revision: D9998991

fbshipit-source-id: 27a8f5180d7516c3bf61b11192672142f77abccc
2018-09-24 10:39:43 -07:00
Matt Glazar
0cb3add8b0 Remove old workaround in tests
Summary: D6612669 introduced a workaround for edenfs not running as a child of sudo if you run Eden's integration tests as root. D9980225 fixed the underlying bug in 'eden stop' which necessitated the workaround. Remove the now-unnecessary workaround.

Reviewed By: wez

Differential Revision: D9984524

fbshipit-source-id: b9ed7114cd7385a13899d16b4da0d40e6e9fd704
2018-09-21 19:06:16 -07:00
Matt Glazar
0b2bea741d Fix wait_for_shutdown for zombie processes
Summary:
wait_for_shutdown waits for the process to no longer be alive using kill. Unfortunately, kill considers a zombie process (i.e. a process whose parent process hasn't reaped its children) to be alive. Teach wait_for_shutdown to consider zombie processes as dead.

Here's how I discovered this bug:

1. Launch edenfs via 'eden start'
2. Send SIGSTOP to edenfs
3. Call wait_for_shutdown on edenfs

edenfs' parent process (sudo) noticed edenfs' SIGSTOP and sent SIGSTOP to itself. sudo became stuck and never reaped its child edenfs process. Thus, edenfs was a zombie process, and wait_for_shutdown complained.

Reviewed By: chadaustin

Differential Revision: D9980225

fbshipit-source-id: c2663a850225775571b02553ccf9e2d460241b6d
2018-09-21 19:06:16 -07:00
Matt Glazar
f39817488a Add tests for wait_for_shutdown
Summary: I plan on fixing a bug in wait_for_showdown. wait_for_showdown lacks test coverage, so my change could easily break wait_for_showdown. Improve wait_for_showdown's test coverage to prevent bugs.

Reviewed By: chadaustin

Differential Revision: D9980226

fbshipit-source-id: 3f5019a2c5be32b75ca3daa25e799e956c93dab4
2018-09-21 14:52:19 -07:00
Matt Glazar
884791802f Remove unused parameter from wait_for_shutdown
Summary:
wait_for_showdown doesn't use its instance parameter. Delete it.

This diff should not change behavior.

Reviewed By: chadaustin

Differential Revision: D9980227

fbshipit-source-id: bfc2dd6d84854b20e8c04fc0391edff50d6d0a49
2018-09-21 11:52:26 -07:00
Wez Furlong
de605edbe1 change default entry generation to 0
Summary:
While looking into the ESTALE issue, I was tracing through
the kernel code.  I found that the root inode is set up with a generation
of 0 rather than 1 in this portion of the kernel code:

diffusion/LK/browse/v4.11-fb/fs/fuse/inode.c;abf7d7755299ee009f0c3cba40fcdcd038a212ac$650

The consequences of the generation being different are that the kernel
will report an ESTALE result when returning the dentry:

diffusion/LK/browse/v4.11-fb/fs/fuse/inode.c;abf7d7755299ee009f0c3cba40fcdcd038a212ac$690

This diff zero-initializes the entry result struct and explicitly sets the generation field to 0.

Sadly, this did not impact the manifestation of the ESTALE behavior that I've been running down.

It's also worth noting that the source of the `1` was from reading this comment in libfuse:
0a519c9772/include/fuse_lowlevel.h (L78-L79)
> The generation must be non-zero, otherwise FUSE will treat it as an error.

That isn't true of the kernel component.

Reviewed By: chadaustin

Differential Revision: D9944646

fbshipit-source-id: 9c1e2f4faec40a3aa446a4646d4518a854a1d73c
2018-09-20 12:54:24 -07:00
Wez Furlong
1f9d381451 increase information in some fuse debug statements
Summary: I wanted to see more details from the fuse requests, so log them.

Reviewed By: strager

Differential Revision: D9944649

fbshipit-source-id: 143703528fa029ed51e6cb42a5f6d8b3b0230ca3
2018-09-20 12:54:24 -07:00
Wez Furlong
08323479d6 adopt new thrift streaming API
Summary:
In heap profiles we observed a lot of objects associated
with the journal related to the subscription path.   Those objects
appear to be alive for the duration of the subscription session,
so it gives us good reason to move forwards with updating to the
newer thrift streaming API.

This diff introduces a new endpoint `subscribeStream` that uses
the new RSocket based subscription channel.

Both the Eden server and the watchman client are able to deal
with connections from/to old versions of the server which checks
off the box around push safety.

Once this is widely deployed we can remove `StreamingSubscriber.{cpp|h}`
from the eden code base, and can remove the `legacySubscribe` code
from the watchman code base.

Reviewed By: strager

Differential Revision: D9595967

fbshipit-source-id: 0843e56315f83f1e5fb9bc827b7ee6cf1bf507a6
2018-09-20 12:54:23 -07:00
Yedidya Feldblum
e9e59f8707 Cut assorted dead includes of folly/MoveWrapper.h
Summary: Cut assorted dead `#include`s of `folly/MoveWrapper.h`.

Reviewed By: aary

Differential Revision: D9934365

fbshipit-source-id: f44aa0dd0d8d482e2dc125983929ea8e7fdf974e
2018-09-20 01:54:26 -07:00
Adam Simpkins
ab319c0b25 add a tool for generating snapshots of Eden data
Summary:
This begins adding a framework for generating snapshots of Eden state for use
in tests.  I plan to add a few kinds of tests based on these snapshots:

- Tests that ensure Eden can successfully load snapshots created by older
  versions of the code.

- Tests that corrupt the snapshot data in various ways and then confirm that
  it can be repaired by `eden fsck` and/or still loaded successfully by
  `edenfs` even if it was not repaired with `fsck` first.

This code still needs some additional functionality, but I figured it was
worth checking in what I have so far.  The main functionality that remains to
be added is unpacking the snapshots and updating absolute paths inside the
config files so that they work in the new path where they were unpacked.

Reviewed By: strager

Differential Revision: D9690267

fbshipit-source-id: a2660e49b84d7833e6778108d9abe081ab7e2cbd
2018-09-19 15:07:33 -07:00
Adam Simpkins
8c86c0c8f6 update eden doctor to fix parent commit inconsistencies
Summary:
Update `eden doctor` to automatically fix inconsistencies in Eden and
Mercurial's view of the current parent commit by updating Eden to point to
Mercurial's current p1 commit.

The previous instructions were to use `hg reset --keep` to try and reset
Mercurial's data to point at Eden's parent commit.  However, the most common
case where Eden and Mercurial can get out of sync is after a Mercurial command
has been interrupted, and Mercurial rolled back a transaction without telling
Eden.  In this case the commit that Eden points at does not exist at all, so
trying to use it fails.

Reviewed By: strager

Differential Revision: D9893097

fbshipit-source-id: 3817b83805c7a9959037941204a95ad2bbff2890
2018-09-18 20:36:22 -07:00
Adam Simpkins
15684f2d42 move the _cleanup_tmp_dir() function to integration.lib.util
Summary:
Move the `_cleanup_tmp_dir()` function out of the integration lib's testcase
module, and make it a public function in the integration lib util module.

This will make it easier to re-use from some other python utilities that need
to be able to clean up Eden state directories.

Reviewed By: strager

Differential Revision: D9690266

fbshipit-source-id: 157c5221f81f90a3e9612315681459d16693cdbc
2018-09-18 19:53:23 -07:00
Adam Simpkins
21665a1597 disable hg telemetry logging in Eden tests
Summary:
Update the Eden unit tests and integration tests to set the `NOSCMLOG`
environment variable when running `hg` commands.  This ensures that our
mercurial telemetry wrapper does not log events from Eden test runs.

Reviewed By: quark-zju, strager

Differential Revision: D9893096

fbshipit-source-id: c0dd4b5eb042dcb5e9493c89aaee10a513022bae
2018-09-18 12:08:55 -07:00
Matt Glazar
edbb3838ba Fix crash during inode scan
Summary:
If the overlay file for a directory is corrupted (e.g. empty), Overlay::scanForNextInodeNumber throws. This causes Eden to crash on start [1]. Fix the crash by ignoring corrupted directories.

[1] `test_mount_possible_after_corrupt_directory_and_cached_next_inode_number` reproduces this crash.

Reviewed By: chadaustin

Differential Revision: D9806105

fbshipit-source-id: 1b95083b6a6aa253a2296d6f754edbf4b9f64734
2018-09-17 14:23:53 -07:00
Mark Thomas
173e58e9de add txnutil.mayhavesharedpending override
Summary: Override `txnutil.mayhavesharedpending` in the same way as `txnutil.mayhavepending`.

Reviewed By: strager

Differential Revision: D9834375

fbshipit-source-id: 7cd9d35121957343e8b15728485457072de047b5
2018-09-15 03:22:23 -07:00
Lee Howes
e8e25257cf Future<T>::then Future<T>::then() -> Future<T>::thenValue or thenTry.
Summary:
Part of the larger project to modify Future<T>::then to be r-value qualified and use Future<T>::thenTry or Future<T>::thenValue.

The goal is to disambiguate folly::Future and to improve type and lifetime safety of Future and its methods.

Codemod:
  future<T>.then(callable with operator()(not-a-try)) to future<T>.thenValue(callable with operator()(not-a-try)).
  future<T>.then(callable with operator()()) to future<T>.thenValue(callable with operator()(auto&&)).
  future<T>.then(callable with operator()(auto)) to future<T>.thenValue(callable with operator()(auto)).
  future<T>.then(callable with operator()(folly::Try<T>)) to future<T>.thenTry(callable)

Reviewed By: Orvid

Differential Revision: D9819578

fbshipit-source-id: f9e31f47354c041ecbf0a90953cbe50ebfda6adc
2018-09-14 17:10:57 -07:00
Matt Glazar
b3a7d80c03 Print inode tree on overlay test failure
Summary: When a RawOverlayTest test fails, it's sometimes difficult to diagnose the failure because assertions use inode numbers instead of file paths. When a test fails, include inode data (with file paths) in the failure message.

Reviewed By: chadaustin

Differential Revision: D9806106

fbshipit-source-id: 6160632bf8c64ceeb84e9d4709347e9268747ca4
2018-09-13 14:55:03 -07:00
Chad Austin
b861392284 Fix eden debug unload . from the root of the checkout
Summary:
The C++ code disallows use of "." in RelativePaths, but it's
reasonable for users of the Thrift API to pass "." to indicate the
root of the mount. Handle that in the EdenServiceHandler.

Reviewed By: strager

Differential Revision: D9647776

fbshipit-source-id: b61c2d1c0dcd69ccfa38bf27379281d10cdf1ceb
2018-09-13 14:55:03 -07:00
Matt Glazar
57ec146629 Refactor setup code in RawOverlayTest
Summary:
Reduce some code duplication in RawOverlayTest:

* Factor testDir_-to-AbsolutePath conversion into a getLocalDir function.
* Factor Overlay construction into a loadOverlay function.
* Use getLocalDir to construct the path to next-inode-number.

This refactor will let me use getLocalDir for more things in future diffs.

This diff should not change behavior.

Reviewed By: chadaustin

Differential Revision: D9813443

fbshipit-source-id: ab0dc88d36e91fc04e0aeb48468060b93b48f0ec
2018-09-13 14:24:14 -07:00
Matt Glazar
cbcb6eafca Delete stale comment
Summary:
Eden keeps track of the the highest-allocated inode number using the next-inode-number file. The TODO comment in Overlay::scanForNextInodeNumber is thus out of date. Delete the outdated comment since the feature has already been implemented.

This diff should not change behavior.

Reviewed By: chadaustin

Differential Revision: D9806107

fbshipit-source-id: f546eb179b86a11a6c4bf0d5f945dc7dbbf29160
2018-09-13 13:23:43 -07:00
Chad Austin
d986fed38c always unload trees prior to checkout
Summary:
The checkout operation is a bit hamstrung, performance-wise, when
inodes are loaded. If it's possible the kernel has a reference to an
inode, we can't short-circuit the checkout operation and instead must
precisely add and remove children from the source control tree and
persist the new children and inode numbers into the overlay.

It's much faster if we treat checkout as an inode-number-invalidating
change and unload all inodes that aren't referenced by the kernel.

Reviewed By: strager

Differential Revision: D9781532

fbshipit-source-id: 50912cf89dbe9ae1bd7ef91fdf7bf8ee5eda8667
2018-09-12 14:37:25 -07:00
Chad Austin
5567363018 add a function that only unloads children unreferenced by FUSE
Summary: Add yet another unloading code path... This one is used for fast checkouts.

Reviewed By: strager

Differential Revision: D9781956

fbshipit-source-id: ae89377aea823f94e2ec1bcc2fa209c8f9bc821c
2018-09-12 14:37:25 -07:00
Chad Austin
5070d76451 fix TreeInode::unloadChildrenNow so it unloads trees
Summary:
unloadChildrenNow would only unload files or trees at the leaf. Apply
the fixes from D8302998 to unloadChildrenNow, which is only called
during takeover.

Reviewed By: strager

Differential Revision: D9774970

fbshipit-source-id: c2f4d1e6b838cc3b9e99eb8786114e643128a519
2018-09-12 14:37:24 -07:00
Matt Glazar
aa3beac504 Work around LSAN reports for hg_importer_helper
Summary: LSAN detects leaks for Python's and Hg's code. When running Eden's tests, whenever hg_importer_helper exits, LSAN prints lengthy leak reports. (Eden ignores hg_importer_helper's exit code, so LSAN's reports don't cause tests to fail.) Fix the log spam by disabling LSAN for hg_importer_helper.

Reviewed By: wez

Differential Revision: D9756053

fbshipit-source-id: 457404c46e1c81f52c2ad754ab67fd180d26935c
2018-09-11 11:36:21 -07:00
Wez Furlong
d191495cac allow mononoke to be used with www
Summary: This hardcoded list is blocking using eden + mononoke with wwww

Reviewed By: chadaustin

Differential Revision: D9762557

fbshipit-source-id: 40991b26b702aa87a86a66934a069995d70f9f34
2018-09-11 10:54:58 -07:00
Chad Austin
29548a00c5 add top pids to eden top output
Summary:
To diagnose why a process is hitting Eden so hard, show the top pids
in eden top's output too.

Reviewed By: strager

Differential Revision: D9486293

fbshipit-source-id: 0714c354cafef4dae60b2615d20f7e940e24daf0
2018-09-10 13:52:52 -07:00
Chad Austin
9a2c376eec add eden top command
Summary:
Add a curses-based `eden top` command that displays the top process
names currently accessing an Eden mount over FUSE.

In the future, I'd like to extend this to count and record Thrift
calls too.

Reviewed By: strager

Differential Revision: D9477936

fbshipit-source-id: f878f2e67f4ea24c036880eb4b1162597dc04185
2018-09-10 13:52:52 -07:00
Chad Austin
e750ab68fe expose FUSE accesses over Thrift
Summary:
Add a Thrift API for reading the pid access logs from each
EdenMount/FuseChannel. Used in a future diff.

Reviewed By: strager

Differential Revision: D9477867

fbshipit-source-id: 0897a915ca654bca952aecc123ea40105830a75b
2018-09-10 13:52:51 -07:00
Chad Austin
e88177a2f3 count FUSE accesses by process ID
Summary: Begin tracking pids passed into FUSE in the ProcessAccessLog.

Reviewed By: strager

Differential Revision: D9595795

fbshipit-source-id: 02e5fefebcd0de860274409ba6258f14fa050b55
2018-09-10 13:52:51 -07:00
Lee Howes
f28ef8281c [] Future<T>::then Future<T>::then(not-try-task) -> Future<T>::thenValue(task). - 2/11
Summary:
Part of the larger project to modify Future<T>::then to be r-value qualified and use Future<T>::thenTry or Future<T>::thenValue.

The goal is to disambiguate folly::Future and to improve type and lifetime safety of Future and its methods.

Codemod:
  future<T>.then(callable with operator()(not-a-try)) to future<T>.thenValue(callable with operator()(not-a-try)).
  future<T>.then(callable with operator()()) to future<T>.thenValue(callable with operator()(auto&&)).
  future<T>.then(callable with operator()(auto)) to future<T>.thenValue(callable with operator()(auto)).

Reviewed By: Orvid

Differential Revision: D9696716

fbshipit-source-id: d71433c75af8422b2f16733c0b18a417d5a4cf2e
2018-09-07 11:07:25 -07:00
Matt Glazar
bdf73e42de Fix broken build
Summary:
It looks like D9477181 conflicted with D9635507, causing a compile error:

```
eden/fs/utils/ProcessNameCache.cpp:74:15: error: no member named 'names' in 'folly::LockedPtr<folly::Synchronized<facebook::eden::ProcessNameCache::State, folly::SharedMutexImpl<false> >, folly::LockPolicyExclusive>'
        state.names.emplace(pid, ProcessName{detail::readPidName(pid), now});
        ~~~~~ ^
eden/fs/utils/Synchronized.h:48:10: note: in instantiation of function template specialization 'facebook::eden::ProcessNameCache::add(pid_t)::(anonymous class)::operator()<folly::LockedPtr<folly::Synchronized<facebook::eden::ProcessNameCache::State, folly::SharedMutexImpl<false> >, folly::LockPolicyExclusive> >' requested here
  return update(wlock);
         ^
eden/fs/utils/ProcessNameCache.cpp:58:3: note: in instantiation of function template specialization 'facebook::eden::tryRlockCheckBeforeUpdate<folly::Unit, facebook::eden::ProcessNameCache::State, (lambda), (lambda)>' requested here
  tryRlockCheckBeforeUpdate<folly::Unit>(
  ^
eden/fs/utils/ProcessNameCache.cpp:81:15: error: no member named 'waterLevel' in 'folly::LockedPtr<folly::Synchronized<facebook::eden::ProcessNameCache::State, folly::SharedMutexImpl<false> >, folly::LockPolicyExclusive>'
        state.waterLevel += 2;
        ~~~~~ ^
eden/fs/utils/ProcessNameCache.cpp:82:19: error: no member named 'waterLevel' in 'folly::LockedPtr<folly::Synchronized<facebook::eden::ProcessNameCache::State, folly::SharedMutexImpl<false> >, folly::LockPolicyExclusive>'
        if (state.waterLevel > state.names.size()) {
            ~~~~~ ^
3 errors generated.
```

Dereference `state` to fix the error.

Reviewed By: chadaustin

Differential Revision: D9673324

fbshipit-source-id: 5143cd22baf66307e5aacb0a04669de69dde99e8
2018-09-05 21:23:16 -07:00
Chad Austin
b55e4dbb58 introduce a ProcessAccessLog
Summary:
Add a ProcessAccessLog that supports cheaply tracking pids passed
into FUSE. It's a write-many, read-maybe access pattern, so the code
is careful to add as little latency as possible on the hot path.

Reviewed By: strager

Differential Revision: D9477839

fbshipit-source-id: 6928c1d09d55c2b0c0958ac2cb0dc91ec21b370c
2018-09-05 15:06:58 -07:00
Chad Austin
0cc3121417 Minor FuseChannel optimizations
Summary: While looking at FuseChannel I noticed an unnecessary Future.

Reviewed By: strager

Differential Revision: D9595672

fbshipit-source-id: 5c84822c4f2c4c3c78b88456e44728e463d5a1e8
2018-09-05 15:06:58 -07:00