Commit Graph

987 Commits

Author SHA1 Message Date
Adam Simpkins
fe1c35f781 move the privhelper APIs into a PrivHelper class
Summary:
Move all of the privhelper functionality into a PrivHelper class.  The
ServerState object now stores the PrivHelper object to use, rather than having
a global singleton.

This will make it easier to stub out the PrivHelper functionality during unit
tests.

Reviewed By: wez

Differential Revision: D6929862

fbshipit-source-id: e3edcb0a03ba9afdf34554cb961fd74557cdd6e3
2018-02-08 19:36:03 -08:00
Adam Simpkins
fd2aa6a596 remove the --thrift_address command line flag
Summary:
Drop the --thrift_address flag, and always create the thrift socket using a
fixed name under the `.eden` directory.  The location of the `.eden` directory
is still configurable with the `--edenDir` argument.

There isn't really much benefit to making the socket path be configurable
separately from the .eden directory path, and it adds to the code complexity.
For instance, while you can tell eden to listen on a TCP socket instead of a
Unix domain socket, that functionality has been broken since D4637285
introduced a `CHECK()` statement that crashes the code when using a TCP socket.

Reviewed By: wez

Differential Revision: D6929863

fbshipit-source-id: ee5f7341d01d3ce522cae936ef3c133bba3f18f7
2018-02-08 19:36:03 -08:00
Adam Simpkins
bc93fd13b6 update diff code to use previously retrieved UserInfo
Summary:
Update EdenMount::diff() to use the UserInfo object stored in the shared
ServerState rather than calling UserInfo::lookup() on each diff operation.

Reviewed By: wez

Differential Revision: D6929865

fbshipit-source-id: a68ab1fa9eb345b59972e67c3aac258b4dbcdab5
2018-02-08 19:36:03 -08:00
Adam Simpkins
265b17d188 add a new ServerState class to store process-wide state
Summary:
Add a new ServerState class to store process-wide state that is shared across
multiple mounts.  Up until now we have passed around the shared state data as
separate variables.

This is intentionally separate from the existing EdenServer class to allow unit
tests to create EdenMount objects without an EdenServer object.

Reviewed By: wez

Differential Revision: D6929861

fbshipit-source-id: 5f22efb6d79dfd70031be1dc37f494c2ad8af902
2018-02-08 16:43:22 -08:00
Chad Austin
d93594e2c9 rename restart_test to takeover_test
Summary:
To me, restart implied shutting down the daemon and restarting it
again.  Perhaps instead of `eden daemon --takeover` we should have
`eden restart`.  But if people typed `eden restart` I imagine they're
trying to debug a problem, so that's probably not the right verb.

Reviewed By: wez

Differential Revision: D6929166

fbshipit-source-id: d568a1940d67f755e4c3656098c58fc81e0a3156
2018-02-08 11:10:51 -08:00
Wez Furlong
2e660e0d45 remove FuseChannel::threadsStoppingFuture
Summary:
We no longer need this and I believe that this was contributing
to this source of flakiness in our CI; this stack trace triggers when
we get an aborted or short read from the kernel:

```
*** Aborted at 1517827659 (Unix time, try 'date -d 1517827659') ***
*** Signal 11 (SIGSEGV) (0x2d0) received by PID 153706 (pthread TID 0x7f63ea37d700) (linux TID 160573) (maybe from PID 720, UID 0) (code: address not mapped to object), stack trace: ***
    @ 0000000002abfa2d folly::symbolizer::(anonymous namespace)::signalHandler(int, siginfo_t*, void*)
                       ./folly/experimental/symbolizer/SignalHandler.cpp:413
    @ 00007f646e96dacf (unknown)
    @ 00007f646e96aa20 __pthread_kill
    @ 0000000001873748 facebook::eden::fusell::FuseChannel::requestSessionExit()
                       ./eden/fs/fuse/FuseChannel.cpp:483
    @ 000000000187d2f7 facebook::eden::fusell::FuseChannel::processSession()
                       ./eden/fs/fuse/FuseChannel.cpp:656
    @ 000000000187dab9 facebook::eden::fusell::FuseChannel::fuseWorkerThread(unsigned long)
                       ./eden/fs/fuse/FuseChannel.cpp:493
    @ 00007f646f267170 execute_native_thread_routine
    @ 00007f646e9637a8 start_thread
    @ 00007f646e047a7c __clone
```

my theory is that we're allowing shutdownImpl to free things out from under other
threads before they've all seen this signal and wound down fully.  This is slightly
speculative in that I haven't managed to reproduce this stack trace on my devserver.

We don't really need this additional signal any longer.

Reviewed By: simpkins

Differential Revision: D6907734

fbshipit-source-id: 0f0138b631a7201fc9a4a1c93c2cde846e869cbd
2018-02-07 17:36:11 -08:00
Chad Austin
0783ffe211 pass InodeTimestamps straight to createHeader
Summary: Small refactoring I should have done with the previous diff.

Reviewed By: simpkins

Differential Revision: D6927152

fbshipit-source-id: 1dcda01134c3d63c62169c5728dba24ca0eebd68
2018-02-07 15:17:51 -08:00
Wez Furlong
a0fb6d9d05 split RocksDbLocalStore out from LocalStore
Summary:
This enables dropping in alternative implementations
of LocalStore and adds a MemoryLocalStore implementation for
use in our tests.

This diff doesn't change the default storage option for the
eden server.  I'll look at adding such an option in a follow up diff.

Reviewed By: chadaustin

Differential Revision: D6910413

fbshipit-source-id: 018bf04e0bff101e1f0ab35e8580ca2a2622e5ef
2018-02-07 11:54:16 -08:00
Adam Simpkins
4fb0ac3809 logging: update LoggerDB::get() to return a reference
Summary:
Change `LoggerDB::get()` to a reference instead of a pointer since this
function can never return null.

Reviewed By: yfeldblum

Differential Revision: D6893206

fbshipit-source-id: af47063918a79c851fd39b838d6c63755166e033
2018-02-06 12:51:07 -08:00
Wez Furlong
b5c47a9ed7 adjust expectations for inode unload integration test
Summary: This should make it less flaky

Reviewed By: simpkins

Differential Revision: D6908454

fbshipit-source-id: 07622b469ec635972290c3a4e5d1ed4b05ddd51a
2018-02-05 22:08:54 -08:00
Adam Simpkins
2d7949f46d update hg_import_helper.py startup behavior to more closely match hg
Summary:
Update hg_import_helper.py to parse the repository's .hg/hgrc file, but then
create the repository object with a fresh UI object that has not parsed that
config yet.

This more closely mimic's the behavior of mercurial's dispatch code invoked
when starting the `hg` command line.  This behavior is required to ensure that
secondary repository objects that get created end up with the correct
configuration, and do not have settings from the original repository's hgrc
file.

The mercurial behavior of parsing the original repository's hgrc file twice
dates back to rHG741f64dfc04d1.

Reviewed By: quark-zju

Differential Revision: D6909449

fbshipit-source-id: 85073ab6ade4ab70247d48bc670c9924e9e6841f
2018-02-05 21:53:46 -08:00
Wez Furlong
72243b218a remove hypothesis timeout setting
Summary:
This was causing flakiness in the form of premature timeouts
generating failure status.  Looking at the docs for hypothesis, this
option is deprecated and slated to be replaced with an infinite timeout
in the future:

http://hypothesis.readthedocs.io/en/latest/settings.html#hypothesis.settings.timeout

Those docs suggest using `hypothesis.unlimited` instead, but I couldn't import
that symbol (maybe our version is too old?) so I'm just using 0 which means
that no timeout will be applied.

Reviewed By: simpkins

Differential Revision: D6908200

fbshipit-source-id: 1143d4745fc84d9c14b29ff5a2906a4e776d14fe
2018-02-05 19:35:55 -08:00
Adam Simpkins
d900cc70ff short circuit diff operations for non-materialized trees
Summary:
Update `TreeInode::diff()` to check if its hash matches the source control tree
it is being compared to, and return early if they are identical.

I'm surprised that I forgot to include this initially when implementing
`TreeInode::diff()`

This makes `hg status` faster when a large number of unmodified directories
have been loaded.

Reviewed By: chadaustin

Differential Revision: D6890615

fbshipit-source-id: 561630d0220b4875dbf3678161cdb41a8aa4fc82
2018-02-05 16:08:09 -08:00
Adam Simpkins
e2c1034d26 slight refactoring of TreeInode::diff()
Summary:
This re-orders some of the code in `TreeInode::diff()` slightly.  This should
not affect the behavior of the code.

This moves the `isIgnored` check inside the main `contents_.wlock()` block.
This reduces the number of places where we grab the lock, and will help keep
things simple for an upcoming diff where I need to add some more checks in this
code with the lock held.

This also changes `inodeFuture` to use the new `Future::makeEmpty()`
constructor rather than having to use an `Optional<Future>`

Reviewed By: chadaustin

Differential Revision: D6890616

fbshipit-source-id: 354bbf6a6be6d356fd23e6c0fb6b534679bbe0bb
2018-02-05 16:08:09 -08:00
Adam Simpkins
aa99fe9fff remove files related to open-source buck builds
Summary:
The open source build of Eden with buck has been broken for a while, since buck
removed support for the `thrift_library()` rule.

Lets just remove these files for now since they no longer work.  In the short
term it potentially makes sense for us to just use CMake for open source builds
rather than buck.

Reviewed By: chadaustin

Differential Revision: D6893232

fbshipit-source-id: f6e121f1376321b62be42bae60844dfa07fadf65
2018-02-05 12:21:16 -08:00
Wez Furlong
f5bf949b79 sanity check that the pid is not us for fuse requests
Summary: We don't think this is happening, but let's test it!

Reviewed By: simpkins

Differential Revision: D6888038

fbshipit-source-id: 754b2ec8f78ff513fd350a74505915e2a1e9ba3e
2018-02-02 19:38:05 -08:00
Chad Austin
8801f19064 convenience constructors for InodeTimestamps
Summary: Small things I've needed in later diffs.

Reviewed By: wez

Differential Revision: D6877755

fbshipit-source-id: c9002eb0b92dbd8fe9c4f636d2ca79b25cde331f
2018-02-01 16:24:37 -08:00
Chad Austin
20f7a10bfd split InodeTimestamps into its own file
Summary:
While working on timestamp storage, the fact that
InodeTimestamps was a member of InodeBase kept getting in the way.
Make it its own type.

Reviewed By: simpkins

Differential Revision: D6862835

fbshipit-source-id: 91d8984764f0586b9fa52e961eb5606a530e0416
2018-02-01 12:34:15 -08:00
Adam Simpkins
00a232d868 make Clock::getRealtime() const
Summary: This API seems like it should be const, as it does not modify the clock.

Reviewed By: chadaustin, zhupanov

Differential Revision: D6869719

fbshipit-source-id: c8bf4ccab34538b59e6baeedd0b0ff88b328236e
2018-02-01 11:19:15 -08:00
Andrew Gallagher
458ed4af7e Re-run autodeps on all opt-in TARGETS
Reviewed By: luciang

Differential Revision: D6862884

fbshipit-source-id: 731aa9c1e0deac12f3354dd86950aa24923f5cdf
2018-01-31 20:07:10 -08:00
Wez Furlong
afac32487a enable integration tests on sandcastle
Summary:
A little bit of plumbing to enable the watchman<->eden integration tests on sandcastle.

I noticed that we were still referencing the lame thrift par that I removed a little while back,
so let's clean that up.

Reviewed By: simpkins

Differential Revision: D6863221

fbshipit-source-id: 026f3d316d9ac52fe359cedc4e3c88394ec5c7c4
2018-01-31 15:53:40 -08:00
Wez Furlong
89c0c2cb90 clean up fuse init processing
Summary:
This diff moves the mount-time initialization handling
out of the main loop.  This rationale for this is:

* We don't (and shouldn't!) need to process FUSE_INIT for takeover
  processing, and this structure allows us to make stronger assertions
  about our state.
* we can avoid spinning up multiple threads in the (rare!) case that
  the FUSE_INIT fails
* It is now a little harder for exceptions during initialization to
  escape our notice.

In rearranging this stuff, I found a race condition in the worker thread
shutdown; we could erroneously emit a completion event before all of
the threads had been torn down and this resulted in sporadic integration
test failures hitting the assertion for the number of joined threads
in the destructor.

Reviewed By: simpkins

Differential Revision: D6766330

fbshipit-source-id: 32afb5a7c739c75aebfdb0a8f896eec5f41ad33f
2018-01-31 15:08:42 -08:00
Chad Austin
e9765e7c37 have eden doctor unmount unconnected mounts
Summary:
If we fail to lstat a mount because the FUSE daemon is
unconnected, go ahead and unmount it.

Reviewed By: simpkins

Differential Revision: D6848115

fbshipit-source-id: df797b15956db24c4ac87dc6d4cd0a7177dd20ef
2018-01-31 11:48:21 -08:00
Wez Furlong
53b84df124 allow running integration tests on sandcastle
Summary:
This is a fairly minimal attempt at asking sandcastle to
run our tests as root.  This is inspired by D6608746 but is for
the moment pretty coarse; I just want to see how successful this
is before finishing this off nicely, which means splitting our
contbuild config into two pieces along similar lines as D6608746;
one piece would run the tests as usual without root privileges
whilst the other would run just the integration tests with root
privs.

Reviewed By: chadaustin

Differential Revision: D6612669

fbshipit-source-id: 9a730b02424e939dd3509310b6265d50d1102e77
2018-01-31 11:48:21 -08:00
Wez Furlong
7ab70a5493 adjust setattr expectations when run as root
Summary: Rather than EPERM we get EACCESS when running as root

Reviewed By: chadaustin

Differential Revision: D6853303

fbshipit-source-id: c6743c8d036a24255d2d31c560034c972a0253c7
2018-01-30 21:50:39 -08:00
Wez Furlong
f82026e4fb don't throw in the version check if eden is not installed
Summary:
in our sandcastle environment, eden is not currently
installed and the tests that look at the version are throwing
an error when the rpm query fails.

Don't do that!

Reviewed By: simpkins

Differential Revision: D6853305

fbshipit-source-id: d17cb1fb0253ef5ae5000695b6ec5bcda4a6a448
2018-01-30 21:50:39 -08:00
Wez Furlong
d6adcfc058 add fsattr utility for testing purposes
Summary:
This is the spiritual successor to D3302706 which originally
wanted to solve this by adding a python extension.  That would prove
to be too painful for the opensource build so it was shelved.

We now need to be able to run our tests in an environment that doesn't
have the `attr` rpm installed so this is a good time to fix this
in a more portable way.

This diff adds a little wrapper around the functions that we already
have for consuming extended attribute information and augments them
with another to list attributes.

The utility emits output in json format and is intended to be fed
directly into the helper functions we have in `fs.py`.

Reviewed By: chadaustin

Differential Revision: D6851182

fbshipit-source-id: 3d1d1a351f2e01405645d45658d1c8bc61a659a4
2018-01-30 21:50:39 -08:00
Chad Austin
d0823ab865 unbox Dir Entries
Summary:
Dir's contents were represented as a vector of 64-bit
pointers to 48-byte structs.  This change removes that layer of
indirection, reducing memory usage and slightly pessimizing insertion.

The diff is mostly mechanical outside of the TreeInode.h changes and
calls to emplace..

I'll run memory tests tomorrow, though it's a gamble as to whether
private bytes will show a difference.  I may need to shrink the Entry
struct too.

Reviewed By: wez

Differential Revision: D6804957

fbshipit-source-id: b126656dbc7951565e74b6401adde6353e809056
2018-01-30 15:11:55 -08:00
Wez Furlong
a3b148fddb add thrift takeover serialization
Summary:
This adds version 3 nee 2 of the takeover serialization,
which uses thrift to represent the data.  Even though it is logically
version 2 I'm naming it version 3 because we're taking advantage of
the MessageType values from Version 1 which allowed numerical values
1 or 2 to represent different data types.

In this diff we now formalize that first word as the protocol version
and to avoid ambiguity are starting the new version value at 3.  I
did briefly consider using the name Version2 to refer to this and setting
the value in the enum to 3, but I didn't want to become known for
API hate crimes against my fellow engineers.

Reviewed By: simpkins

Differential Revision: D6733406

fbshipit-source-id: e2067365e4e8b388490440fd73ab504544011846
2018-01-30 14:21:18 -08:00
Wez Furlong
be130bc880 add version handshake to takeover protocol
Summary:
Whilst chatting with simpkins we realized that we lost
the handshake portion of the takeover protocol during a refactor.

The handshake is important for a couple of reasons:

1. It prevents unmounting and loosing all the mounts in the case
   that sometime decides to netcat or otherwise connect to the
   socket
2. It gives us an opportunity to short circuit any heavy lifting
   if we know that it will be impossible to succeed.
3. It allows us to rollback to earlier builds with older versions
   of the takeover protocol.

This diff adds a little bit of machinery to enable passing a set of supported
takeover protocol version numbers.  The intent is to retain support for
the two of these at a time; any time we change the encoding/protocol
for takeover we'll bump the version number and add supporting code
to handle the new format, retaining support for the prior version.

Retaining the ability to handle the prior version allows us to downgrade
to an earlier build gracefully if/when the need arises.

I opted to do this here rather than by bumping the `kProtocolID`
constant in `UnixSocket.h` becase we're not really changing the
lowest level of the protocol; just the takeover specific portions.

I haven't actually changed the takeover serialization in this diff,
but do have some work on that happening in D6733406; that diff will
be amended to take advantage and demonstrate how this versioning
scheme works.

A key thing to note about the implementation of this diff is that
the client sends the version number to the server, but doesn't
add any explicit version encoding in the response we receive.
This is deliberate and allows us to upgrade prior builds to
this new scheme.  I'll add a more definitive check for this
situation when I actually rev the format in the following diff.

Reviewed By: simpkins

Differential Revision: D6743065

fbshipit-source-id: c991cebfee918daad098105ca6bcfef76374c0ff
2018-01-30 14:21:18 -08:00
Chad Austin
a06f12e6b0 avoid a strlen in DirHandle
Summary:
Tiny thing I noticed when reading code.  Keep the entry name
as a StringPiece rather than bouncing through char*.

Reviewed By: zhupanov

Differential Revision: D6820080

fbshipit-source-id: 884e55f74094f44012efbe44b86d8e5903300967
2018-01-30 13:35:49 -08:00
Chad Austin
144a47d1ae fix status/diff when symlinks change
Summary:
isSameAs calls getSha1 which was failing on symlinks.  The
original concern was that asking for the SHA-1 of a symlink is
ambiguous: do you want the hash of the symlink or the target?  But we
already check for whether you are requesting the SHA-1 of a symlink in
EdenServiceHandler, so it's redundant and incorrect to check in
FileInode too.

Reviewed By: simpkins

Differential Revision: D6847489

fbshipit-source-id: 13966da06bcde75c5c568e09fef14e735de47cfb
2018-01-30 13:35:49 -08:00
Chad Austin
00d6bcc115 allow eden mount and eden unmount to take multiple paths
Summary: A minor convenience for mass mounting and unmounting.

Reviewed By: simpkins

Differential Revision: D6803003

fbshipit-source-id: 16c0d6982ba0ce2dba9900ee15013fcec8bc5ad5
2018-01-29 11:36:19 -08:00
Michael Bolin
7673f16536 Add support for a more complete set of options to hg status.
Summary:
This adds support for the following flags for `hg status` in the Rust wrapper:

* `--all`
* `--modified`
* `--added`
* `--removed`
* `--deleted`
* `--clean`
* `--unknown`
* `--ignored`
* `--no-status`
* `--copies`

There is now a `create_print_config()` function that takes the parsed arguments
and distills them into a `PrintConfig`, which describes the net configuration
as a result of all the flags. (Note that some flags can interfere with each other,
e.g., `--no-status` forces `--copies` to be disabled.)

While here, I cleaned up a bunch of duplication in the code that prints the
status to stdout. Much of the duplication in the old implementation has been
encapsulated in a closure within the new `print_status()` function.
This also made it easier to implement `--copies` for all of the different status
types.

Incidentally, this helps us specify `listIgnored` correctly when calling the
`getScmStatus()` Thrift method as we now keep track of whether the user
specified `--ignored`. This is particularly important for the Eden integration
test suite because its `assert_status()` helper method calls
`hg status --print0 -mardui` by default, so `buck test eden/...` makes much
greater use of the Rust wrapper than it did before.

Reviewed By: wez

Differential Revision: D6770916

fbshipit-source-id: fea1a159addca6d16caa1b7019dc11dc2dcb3e1b
2018-01-26 17:52:14 -08:00
Chad Austin
697eb8a6fd run clang-format across eden
Summary:
```
find . \( -iname '*.cpp' -o -iname '*.h' \) -exec arc lint --apply-patches {} +
```

Differential Revision: D6820436

fbshipit-source-id: 173c0e3b5c023c1c9276f34e17d732f1dd161892
2018-01-26 11:20:31 -08:00
Chad Austin
13176097df bring back fbstring for PathComponent - reduces PathMap memory usage
Summary:
In my benchmarks, using fbstring over std::string for PathMap is
worthwhile.  There are a lot of entries stored in PathMap and the fact
that fbstring is a word smaller than std::string adds up.

Differential Revision: D6820204

fbshipit-source-id: 1ac34a81828891eb8125b13a074de6ed9715edad
2018-01-26 10:51:58 -08:00
Sergey Zhupanov
ec9ff7e3ef Add comments about postponed umask/permissions for mkdir and mknod
Summary:
Added comments linking to the task with discussion of why we are postponing
proper handling of umask and permissions in general for mkdir and mknod.

Reviewed By: wez

Differential Revision: D6808696

fbshipit-source-id: a6d74ea08448c8578282dc146ac81da187d4409c
2018-01-25 20:51:16 -08:00
Chad Austin
7a909f6168 avoid a crash in eden doctor if any active mounts are unconfigured
Summary:
My stale mounts check regressed eden doctor's handling of
unconfigured mounts.  For now, just skip them, and add a test that
eden doctor doesn't crash.

Reviewed By: simpkins

Differential Revision: D6801445

fbshipit-source-id: 65d2f9028af651ef487a7ce6c334f387b541492d
2018-01-25 15:14:58 -08:00
Chad Austin
916f069b91 bring back eden doctor's stale mounts check - filter by st_uid and st_dev instead of path
Summary:
The prior implementation of StaleMountsCheck filtered by path
and did not correctly handle seeing the same FUSE mount multiple times
in the mount table. This occurred when an Eden mount was created
underneath a bind mount.

Now it only unmounts mounts where st_dev does not match the st_dev of
any active mounts, and where st_uid matches the current user.

Reviewed By: simpkins

Differential Revision: D6787618

fbshipit-source-id: 24e0f156cb74822500d91205349c0e6638c0340c
2018-01-25 15:14:58 -08:00
Wez Furlong
067439b613 update eden to target the treemanifest source of truth
Summary:
Now that we've moved the hg source around, update eden
to point to the source of truth rather than the synced subdir.

I spoke with andrewjcg about the use of header_namespace here;
it is required to be able to reference the headers without changing
the code under scm/hg to be relative to the fbcode root.  We can't
change that code in that way because it has to build standalone
for the opensource consumers.

Remove the duplicated code while we're in here to make sure
that we're not accidentally referencing it anywhere.

Reviewed By: simpkins

Differential Revision: D6792969

fbshipit-source-id: ec55e98c0bde2488c213b1fd9f8baae9868a350c
2018-01-25 14:35:32 -08:00
Rob Sherwood
ed47573b67 Fix open source aliveSince() implementation
Summary:
aliveSince() has a misleading name and I misunderstood.
The correct implementation just returns the timestamp of when
the process started as opposed to my understanding (the number
of seconds since the process started).

Reviewed By: linhbui

Differential Revision: D6789987

fbshipit-source-id: db60bf00f6b07e31d91dfc8ed06d1c1cbe172a64
2018-01-25 10:22:07 -08:00
Chad Austin
8219f5c60a have eden stats show file and tree counts
Summary:
It's interesting to see the total number of loaded files
vs. trees when the loaded inode count is high.

Reviewed By: wez

Differential Revision: D6765874

fbshipit-source-id: 178b30184428bd5cf5e005eb475e4f5a1476c385
2018-01-24 15:29:16 -08:00
Chad Austin
adce4eba1e fix determining which inodes can be unloaded
Summary:
I'm not sure what was wrong with the old code, but I
simplified and clarified all of the time math and now `eden debug
unload` behaves as I'd expect it should.

Reviewed By: simpkins

Differential Revision: D6764962

fbshipit-source-id: 3ed359d4ab4652e95d1538a0982c24185999351c
2018-01-24 15:29:16 -08:00
Chad Austin
c0acea995d remove rdev from state and don't pretend we support it for now
Summary:
rdev doesn't add any value yet. We can add it back if we want
to implement support.

Reviewed By: simpkins

Differential Revision: D6792346

fbshipit-source-id: ce16317074f1daa456737c55804da8fb7f2b7a94
2018-01-24 13:36:05 -08:00
Wez Furlong
3b2fbf93c1 factor out FuseChannel buffer size
Summary: This makes it easier to separate out the fuse initialization logic in a follow on diff.

Reviewed By: simpkins

Differential Revision: D6766329

fbshipit-source-id: 178d97e2302bc283c701039494e4477285abc0af
2018-01-24 11:34:48 -08:00
Wez Furlong
056d7f4917 slightly simplify FuseChannel initialization
Summary:
This slightly improves the code in EdenMount by having
just a single call to the FuseChannel constructor with an optional
`fuse_init_out` instance that we can use to determine if we are
performing a takeover or not.

Reviewed By: simpkins

Differential Revision: D6766328

fbshipit-source-id: ece140a1572e2934a3e35bfe25b83af910346c18
2018-01-24 11:34:48 -08:00
Adam Simpkins
27ef593f70 add type annotations to all functions in commit_test.py
Summary: Add type annotations to the test functions in this file.

Reviewed By: chadaustin

Differential Revision: D6789863

fbshipit-source-id: d298a388b5ea03fcf25047937e747051c8fa682b
2018-01-23 20:50:29 -08:00
Adam Simpkins
4abb5f6720 add integration tests for running "hg commit <path>"
Summary:
Test running `hg commit` with a path argument.  This currently fails if the
path refers to a directory rather than a file.

Reviewed By: chadaustin

Differential Revision: D6789862

fbshipit-source-id: 054ee26ea0fdb843cc12d5e8ac3c3d34b9308017
2018-01-23 20:50:29 -08:00
Sergey Zhupanov
ae0f9c1aa6 Minor stylistic changes.
Summary: Minor stylistic changes that were done during constification but factored out.

Reviewed By: chadaustin

Differential Revision: D6774976

fbshipit-source-id: d18cd339153cf16ff69be0de5f3eb019a4baa1a0
2018-01-23 14:52:34 -08:00
Sergey Zhupanov
25e74d5712 Fixing opt build lint warning introduced by a previously landed revision.
Summary: Added folly::assume_unreachable() to quell the false positive warning.

Reviewed By: wez

Differential Revision: D6787186

fbshipit-source-id: 400695f8cda915557cf4999b1b998a5aefc558f0
2018-01-23 11:49:11 -08:00