Commit Graph

65 Commits

Author SHA1 Message Date
CodemodService FBSourceClangFormatLinterBot
63c0e35bd7 Daily arc lint --take CLANGFORMAT
Reviewed By: zertosh

Differential Revision: D28053932

fbshipit-source-id: d2f903158c49a41a0a19df5cf1af540ba9f90a98
2021-04-28 04:38:27 -07:00
TJ Yin
0cafe52bdd Remove thrift setters
Summary:
Thrift setter API is deprecated since it doesn't bring any value over direct assignment. Removing it can reduce build-time and make our codebase more consistent.

If result of `s.set_foo(bar)` is unused, this diff replaces

    s.set_foo(bar);

with

    s.foo_ref() = bar;

Otherwise, it replaces

    s.set_foo(bar)

with

    s.foo_ref().emplace(bar)

Reviewed By: xavierd

Differential Revision: D27986185

fbshipit-source-id: d90aaf27f25f2ecfcbbbe7886e0c0d784f607a87
2021-04-27 15:16:06 -07:00
Yair Gottdenker
807191cc2e changing AsyncServerSocket::acceptError to receive exception_wrapper
Reviewed By: yfeldblum

Differential Revision: D25514804

fbshipit-source-id: 7e6ad5c6063d2cf5047f656c0f2336b34576c60b
2021-02-20 08:01:53 -08:00
Andres Suarez
21c95391ca Apply clang-format update fixes
Reviewed By: igorsugak

Differential Revision: D25861960

fbshipit-source-id: e3c39c080429058a58cdc66d45350e5d1420f98c
2021-01-10 10:06:29 -08:00
Xavier Deguillard
e50725d2cb inodes: rename FUSE refcount to fs refcount
Summary:
One of the issue that EdenFS on Windows is currently facing is around
invalidation during an update. In effect, EdenFS is over invalidating, which
causes update to be slower than it should be, as well as EdenFS recursively
triggering ProjectedFS callbacks during invalidation. Both of these are a
sub-par UX.

The reason this issue exist is multi-faceted. First, the update code follows
the "kPreciseInodeNumberMemory" path which enforces that a directory that is
present in the overlay needs to be invalidated, even if it isn't materialized.
The second reason is that no reclamation is done for the overlay, combine the
two and you get an update that gets both slower over time and will issue
significantly more invalidation that is needed.

Solving this is a bit involved. We could for instance start by reclaiming
inodes from the overlay, but this wouldn't be effective as we use the fact that
an inode is present in the overlay as a way to know that the file is cached in
the overlay. If we reclaim from the overlay we simply won't be invalidating
enough and some files will be out of date.

It turns out that we already have a mechanism to track what is cached by the
kernel: the fuse refcount. On Linux/macOS, everytime an inode is returned to
the kernel, this refcount incremented, and the kernel then notifies us when it
forgot about it, at which point the refcount can be decremented. On Windows,
the rules are a bit different, and a simple flag is sufficient: set when we
write a placeholder on disk (either during a directory listing, or when
ProjectedFS asks for it), and unset at invalidation time during update. There
is however a small snag in this plan. On Linux, the refcount starts at 0 when
EdenFS starts as a mount/unmount will clear all the kernel references on the
inodes. On Windows, the placeholder aren't disappearing when EdenFS dies or is
stopped, so we need a way to scan the working copy when EdenFS starts to know
which inodes should be loaded (an UnloadedInode really).

The astute reader will have noticed that this last part is effectively a
O(materialized) operation that needs to happen at startup, which would be
fairly expensive in itself. It turns out that we really don't have choice and
we need to do it regardless due to Windows not disallowing writes to the
working copy when EdenFS is stopped, and thus for EdenFS to be aware of the
actual state of the working copy, it needs to scan it at startup...

The first step in doing all of this is to simply rename the various places that
uses "fuse refcount" to "fs refcount" which is what this diff does.

Reviewed By: chadaustin

Differential Revision: D24716801

fbshipit-source-id: e9e6ccff14c454e9f2626fab23daeb3930554b1a
2020-11-04 17:34:01 -08:00
Chad Austin
a6ac98a5a7 thriftfmt
Summary:
Apply automated Thrift formatter. Even if the format is a bit off in a
couple places, and the bikeshed is still being painted, this avoids
unrelated formatting changes later in the stack.

Reviewed By: xavierd

Differential Revision: D24511057

fbshipit-source-id: f1b23578733a8ecf788509e407bc419fa073428d
2020-11-02 13:52:37 -08:00
Xavier Deguillard
695c24f493 fs: ifdef linux/macos only files
Summary:
These don't compile on Windows, and in order to get mode/win to compile, we
need to avoid compiling their contents. Ideally, we could do that in the
TARGETS files with the select statement, but that's not available in fbcode.
Thus, we do the next best thing: ifdef the file entirely.

Reviewed By: wez

Differential Revision: D23871728

fbshipit-source-id: b4d9df6503eaa008e649afd7bdc665cd37a9585d
2020-09-23 12:20:41 -07:00
Xavier Deguillard
2ff478ea62 utils: move win/utils/Stub.h to utils/NotImplemented.h
Summary:
Since the Stub.h now only contains NOT_IMPLEMENTED, let's move it to its own
header outside of the win directory.

Reviewed By: genevievehelsel

Differential Revision: D23696244

fbshipit-source-id: 2dfc3204707e043ee6c89595668c484e0fa8c0d0
2020-09-16 12:31:46 -07:00
Xavier Deguillard
18084befa0 win: remove fuse_init_out from Stub.h
Summary:
With this gone, we will be able to rename and move Stub.h outside of the win
directory.

Reviewed By: genevievehelsel

Differential Revision: D23696243

fbshipit-source-id: ea05b10951fa38a77ce38cd6a09a293364dbeec9
2020-09-16 12:31:46 -07:00
Xavier Deguillard
d48209e3ed build: compile takeover/ on Windows
Summary:
While the code isn't compiled, this makes the thrift definition available to
the rest of the code, eliminating the need for having a stub for
SerializedInodeMap on Windows.

Reviewed By: genevievehelsel

Differential Revision: D23696242

fbshipit-source-id: 8a42dd2ed16887f3b7d161511e07aaa35fd1b968
2020-09-16 12:31:46 -07:00
Victor Zverovich
e3f4a56f6b Migrate to field_ref Thrift API
Summary:
We are unifying C++ APIs for accessing optional and unqualified fields:
https://fb.workplace.com/groups/1730279463893632/permalink/2541675446087359/.

This diff migrates code from accessing data members generated from unqualified
Thrift fields directly to the `field_ref` API, i.e. replacing

```
thrift_obj.field
```

with

```
*thrift_obj.field_ref()
```

The `_ref` suffixes will be removed in the future once data members are private
and names can be reclaimed.

The output of this codemod has been reviewed in D20039637.

The new API is documented in
https://our.intern.facebook.com/intern/wiki/Thrift/FieldAccess/.

drop-conflicts

Reviewed By: yfeldblum

Differential Revision: D22631599

fbshipit-source-id: 9bfcaeb636f34a32fd871c7cd6a2db4a7ace30bf
2020-07-21 11:23:35 -07:00
Lee Howes
2254db881b Replace Future<T>::getTry with Future<T>::result
Summary:
Replace calls to Future<T>::getTry() with Future<T>::result().

This change is behaviour-neutral. It enables us to make the behavior of getTry
match expectations and be blocking, like get, and r-value qualfiied, like
SemiFuture<T>::getTry().

Reviewed By: yfeldblum

Differential Revision: D22527935

fbshipit-source-id: 7fa634375b71c13ee58cb699e5ac8dcd37fe9c30
2020-07-14 11:04:12 -07:00
Xavier Deguillard
3f0dcccd42 mount: unify EdenMount::initialize
Summary:
Next step in unifying the mount path, let's make the initialize the same in
Windows and unices. The only difference is now limited to the .eden directory
which we will be able to implement once regular users can create symlinks.

For the takeover code, the #ifdef is pushed down to the actual code that does
it, this allows the rest of the code to not have to bother about Windows vs
other platforms.

Reviewed By: wez

Differential Revision: D21517478

fbshipit-source-id: d40ca2694d23031ff98e319071e610efa306008f
2020-05-15 13:14:55 -07:00
Genevieve Helsel
9944a5dff5 add EdenServer recovery step and recover after failed takeover data send handshake
Summary:
* This adds a `EdenServer::recover()` method to start back up on unsuccessful takeover data send.
    * On an unsuccessful ping, filfill the `shutdownPromise` with a `TakeoverSendError` continaing the constructed `TakeoverData`. After this `recover` function is called, `takeoverPromise_` is reset, `takeoverShutdown` is set to `false`, and the `runningState_` is set to `RUNNING`.
With taking over from the returned `TakeoverData`, the user will not encounter `Transport not connected` errors on recovery.

* This adds a `EdenServer::closeStorage()` method to defer closing the `backingStore_` and `localStore_` until after our ready handshake is successful.
* This defers the shutdown of the `PrivHelper` until a successful ready handshake.

I also update the takeover documentation here with the new logic (and fix some formatting issues)

Reviewed By: simpkins

Differential Revision: D20433433

fbshipit-source-id: f59e660922674d281957e80aee5049735b901a2c
2020-04-07 09:52:21 -07:00
Genevieve Helsel
8bb3b33f8a add fault injection to TakeoverServer
Summary: This allows for fault injection into the TakeoverServer, which will be helpful when trying to mock a failed "ready" handshake (this will be used by injecting an error, not a timeout).

Reviewed By: simpkins

Differential Revision: D20527046

fbshipit-source-id: 24d493fdac620c759c98b050b6cec6b88587789a
2020-04-07 09:52:21 -07:00
Genevieve Helsel
003bdfe7a5 add additional takeover "ready" handshake
Summary:
For graceful restart takeovers, we would like to implement an additional handshake. This handshake will occur right after the takeover data is ready to be sent to the client, but before actually sending it. This is to make sure the old daemon can recover in case of the client not being responsive (the client replies back to the server, and if no response is recieved in 5 seconds, the server will recover).

There are a few cases here:
* **Server sends ping (two cases discussed below)**
I introduced a new ProtocolVersion. Daemons with this change will now have ProtocolVersion4. The Server checks the max version of the client, and if this version is ProtocolVersion4, we know the client can listen for pings. So we will send the ping. Otherwise, we don't send a ping. With this, we will only send pings if we know the client will be listening for one. The case in which a client isn't listening is if we adopt this change and we downgrade past the change.

* **Server does not send ping and Client knows to listen for ping**
This will be a common case immediately after this change. The client will parse the sent data and check if it matches the "ready" ping, and if it doesn't, the client assumes the server simply sent the Takeover Data.

* **Server does not sends ping and Client doesn't know to listen for ping**
This is the case before this change.

Reviewed By: simpkins

Differential Revision: D20290271

fbshipit-source-id: b68e4df6264fb071d770671a80e28c90ddb0d3f2
2020-04-07 09:52:21 -07:00
Adam Simpkins
e07f8bd7b6 refactor the EDEN_BUG() macro
Summary:
This splits `EDEN_BUG()` into three separate version.  All three crash in
debug mode builds, but in release builds they behave differently:

- `EDEN_BUG()` throws an exception
- `EDEN_BUG_FUTURE(Type)` returns a `folly::Future<Type>` that has been
  fulfilled with an exception.
- `EDEN_BUG_EXCEPTION()` returns a `folly::exception_wrapper`.

The main advantage of this is that this allows the compiler to detect that
`EDEN_BUG()` can never return.  Previously `EDEN_BUG()` was used for all 3 of
these different cases, and its behavior depended on whether `toException()`
was ever called.  As a result we could not easily get the compiler to identify
code paths where we know at compile time that it will never return.

Reviewed By: chadaustin

Differential Revision: D18652103

fbshipit-source-id: 070107c7520f51b05696905fa243de5f8df15958
2019-11-22 15:38:33 -08:00
Chad Austin
4f360eafd2 clang-format
Summary: Formatting had diverged in a few places. Fix that up.

Reviewed By: fanzeyi

Differential Revision: D18123219

fbshipit-source-id: 832cdd70789642f665a029196998928a9173be81
2019-10-24 14:56:43 -07:00
Chad Austin
8cac2bfe6a Remove dead includes in eden
Reviewed By: wez

Differential Revision: D17877514

fbshipit-source-id: e7f8ed8364bdb7a77f293cbdf4b48e8f15e64c30
2019-10-11 16:45:01 -07:00
Andres Suarez
fbdb46f5cb Tidy up license headers
Reviewed By: chadaustin

Differential Revision: D17872966

fbshipit-source-id: cd60a364a2146f0dadbeca693b1d4a5d7c97ff63
2019-10-11 05:28:23 -07:00
Wez Furlong
d58a3c96d8 eden: remove legacy bind mount code
Summary:
This diff removes the logic that consumes the legacy bind
mount list and mounts them on startup.  That functionality has been
replaced with the eden redirect command.

Instead of performing the bind mounts in the server, the server will
now run `eden redirect fixup` to apply that configuration.

This diff also changes the behavior of performBindMounts: previously, if the
bind mount setup failed, we would tear down the entire repo mount.  Since we're
now spawning an external process, it is much more likely that something might
fail and result in a bad experience, so we no longer bail out in that case:
we'll continue and leave the bind mounts as-is.  The user can then use `eden
doctor` or `eden redirect fixup` to sort things out.

Reviewed By: simpkins

Differential Revision: D17236366

fbshipit-source-id: 8b004551a076216f0e5448942f00b5195ee18803
2019-09-30 18:57:14 -07:00
Adam Simpkins
6b5f79c0d2 fbcode_builder: rename add_thrift_cpp2_library() to add_fbthrift_cpp_library()
Summary:
Rename the `ThriftCppLibrary.cmake` file to `FBThriftCppLibrary.cmake`, and
also rename `add_thrift_cpp2_library()` to `add_fbthrift_cpp_library()`.

Explicitly calling this `fbthrift` helps clearly distinguish that this is
intended for use with fbthrift (https://github.com/facebook/fbthrift/), as
opposed to Apache thrift.

Reviewed By: wez

Differential Revision: D16738440

fbshipit-source-id: 9b255e06b71c98ad74a34989f564a211958dcdd5
2019-08-29 16:45:12 -07:00
Adam Simpkins
92fc1d83d9 update license headers in thrift files
Summary:
Update the copyright & license headers in thrift files to reflect the
relicensing to GPLv2+

Reviewed By: wez

Differential Revision: D15487082

fbshipit-source-id: 33f68617037f36c07075fb962a16a4d8f55bd6a6
2019-06-19 17:02:46 -07:00
Adam Simpkins
4bc8682391 update license headers in CMake files
Summary:
Update the copyright & license headers in CMake files to reflect the
relicensing to GPLv2

Reviewed By: wez

Differential Revision: D15487079

fbshipit-source-id: 715e559464c19a0070d6e55a095b3fc7d61ad2f8
2019-06-19 17:02:46 -07:00
Adam Simpkins
aa5e6c7295 update license headers in C++ files
Summary:
Update the copyright & license headers in C++ files to reflect the
relicensing to GPLv2

Reviewed By: wez

Differential Revision: D15487078

fbshipit-source-id: 19f24c933a64ecad0d3a692d0f8d2a38b4194b1d
2019-06-19 17:02:45 -07:00
Lee Howes
5b4a9d3362 Replace Future::then(e, f) with Future::then(V/T)Inline(makeAsyncTask(e, f))
Summary:
Remove calls to Future::then(executor, callback).

This form of Future::then is ambiguous, and does not yet implement the stronger
typing of thenValue and thenTry. It is also tempting to use instead of via,
where it is not obvious that it has the behaviour of wrapping a via call in a
push and pop of the current executor:
.pushCurrentExecutor().via(executor).then(callback).popCurrentExecutor().

With the addition of inline continuations, we can instead make the nesting
explicit at low cost by making it an inline continuation that launches an
asynchronous task on the passed executor.

Reviewed By: yfeldblum

Differential Revision: D15487604

fbshipit-source-id: 24b83f56c4f3e8843a6ce8339c70ff4794500d5b
2019-05-26 19:44:34 -07:00
Orvid King
736f47d917 AsyncServerSocket::AcceptCallback::connectionAccepted to NetworkSocket (attempt #2)
Summary:
The file descriptor API here needs to go away, so switch this API to NetworkSocket

It is expected that this commit will cause a number of Open Source projects to temporarily show up as broken. This is due to the fact that not all projects get synced to Github at the exact same time, so the builds may temporarily be fetching an older version of it's dependencies than it needs to :) It should fix itself quickly.

Reviewed By: yfeldblum

Differential Revision: D14673328

fbshipit-source-id: c5842fa5dc383d50043e0d8228e35d03b10a1c6b
2019-04-10 15:01:32 -07:00
Fred Emmott
9f28060b95 Revert D13966702: [fbcode] AsyncServerSocket::AcceptCallback::connectionAccepted to NetworkSocket
Differential Revision:
D13966702

Original commit changeset: 415622dc347d

fbshipit-source-id: 11ff9cac08174cfaefe20e7e4c5e08dc005aaa39
2019-03-27 08:48:30 -07:00
Orvid King
730bc71c82 AsyncServerSocket::AcceptCallback::connectionAccepted to NetworkSocket
Summary: This is a largely automated codemod that shifts `folly::AsyncServerSocket::AcceptCallback::connectionAccepted` to taking a `NetworkSocket` rather than a file descriptor. This needs to be done as a single atomic change to avoid breaking things.

Reviewed By: yfeldblum

Differential Revision: D13966702

fbshipit-source-id: 415622dc347de53368c404dfbe9a2deae5b75e18
2019-03-26 15:09:39 -07:00
Matt Glazar
49f4c37b67 Add missing copyright notices
Summary: Internal Facebook infrastructure is nagging me about some files not having a Facebook copyright notice. Add a notice to these files to make the nagging stop.

Reviewed By: simpkins

Differential Revision: D14173944

fbshipit-source-id: 7234431224fcf4f86ea56ca2f9108f47ef959d87
2019-03-07 19:32:39 -08:00
Lee Howes
967e3f8a1c Future::onError replaced with Future::thenError
Summary:
Replace Future::onError with Future::thenError:
 * to remove ambiguous typing
 * to ensure that the executor is not lost and the returned Future is still bound to an executor

See:
https://fb.workplace.com/groups/fbcode/permalink/2002251863144976/
for details.

Reviewed By: yfeldblum

Differential Revision: D13784772

fbshipit-source-id: 1d3ede848b7d31c7a197a21b4ff2b31e840040a5
2019-01-30 09:56:15 -08:00
Wez Furlong
3b5315ca43 eden: handlemap.thrift was removed, but not from cmake build
Summary: overlooked because there is no CI exercising this today

Reviewed By: simpkins

Differential Revision: D13475721

fbshipit-source-id: 3e8fe280ab73d249da374129b37d32cd7e17f472
2018-12-15 13:43:31 -08:00
Chad Austin
008497c69a remove SerializedFileHandleMap
Summary: SerializedFileHandleMap is dead code now.

Reviewed By: strager

Differential Revision: D13381629

fbshipit-source-id: ba872aaf8335d2be68d6af0465bd04e4ca59d578
2018-12-13 12:29:13 -08:00
Chad Austin
fcbabf9fc2 folly::Optional -> std::optional
Summary: Eden's on C++17 so fully cross the rubicon!

Reviewed By: strager

Differential Revision: D10498169

fbshipit-source-id: 90ef7e575db7b9a6f80f818cc9a8e2988bbdca7a
2018-10-23 18:51:59 -07:00
Adam Simpkins
dacc8787f3 convert some deprecated Future::then() calls
Summary:
Convert deprecated `folly::Future::then()` calls to `thenTry()` or
`thenValue()` as appropriate.

Reviewed By: chadaustin

Differential Revision: D10503906

fbshipit-source-id: abc0f6f588ad7edd0dd2576544875f4ad0263b83
2018-10-23 13:42:12 -07:00
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
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
Chad Austin
7a686d9c8f don't pass next inode number through thrift
Summary:
The desired end state for how next inode number gets passed across
takeover. This should not land as is - the prior diffs need to land
and wait for a while until everyone transitions.

Reviewed By: simpkins

Differential Revision: D8195550

fbshipit-source-id: 2fc40f881cc1a331df95ef99f7e9e4f2e69c8643
2018-08-23 22:55:21 -07:00
Adam Simpkins
19d922b0e6 add integration tests for CLI behavior inside a stale mount
Summary:
Add some integration tests that invoked "eden doctor" and "eden list" inside a
stale mount point, and confirms that they work correctly.  These commands do
fail in dev builds, since python itself does not handle this error.
Fortunately XAR-based python archives avoids this error, so these commands
work in opt mode builds.

Reviewed By: strager

Differential Revision: D8905489

fbshipit-source-id: 0666f8cb0715d61697253bee9fe0bde2f4a3fa15
2018-07-27 18:36:55 -07:00
Lee Howes
2b4e4f861e Future<T>::then 1/n: Future<T>::then(try-task) -> Future<T>::thenTry(task).
Summary:
Overall plan to modify Future<T>::then to be r-value qualified and use
Future<T>::thenTry or Future<T>::thenValue.

1/n: Codemod rvalue-future<T>.then(callable with operator()(Try<T>)) to rvalue-future<T>.thenTry(callable with operator()(Try<T>)).

Reviewed By: simpkins

Differential Revision: D8961903

fbshipit-source-id: ff17b7833d240c221197cdf0bf914b8a39f80b07
2018-07-23 18:51:38 -07:00
Chad Austin
22e46cfe74 standardize on std::chrono_literals
Summary:
This is not at all clear from cppreference.com, but per
https://www.youtube.com/watch?v=dTeKf5Oek2c, it sounds to me like
recommended practice is to either:

`using namespace std::chrono_literals` (or string_literals or
whatever) to pull in a focused set of literals.

or

`using namespace std::literals` to pull in all standard literals.

or

`using namespace std` to pull in everything.

`using namespace std::literals::chrono_literals` is unnecessarily
verbose.

Adopt those standards in Eden.

Reviewed By: simpkins

Differential Revision: D8060944

fbshipit-source-id: 4d9dd4329698b7ff5e5c81b5b28780ca4d81a2a1
2018-05-18 16:51:15 -07:00
Adam Simpkins
684fa29593 update folly::Init to call folly::initLogging()
Summary:
Update the folly::Init code to define a `--logging` command line flag, and call
`folly::initLoggingOrDie()` with the value of this command line during
initialization.

This is similar to the existing code that initializes the glog library.
(Programs can use both glog and folly logging together in the same program, and
I expect that many programs will do so as parts get converted to folly::logging
and parts remain using glog.)

Reviewed By: yfeldblum

Differential Revision: D7827344

fbshipit-source-id: 8aa239fbad43bc0b551cbe40cad7b92fa97fcdde
2018-05-15 12:38:01 -07:00
Chad Austin
72be488e3d add convenient operator literals for the various path piece types
Summary:
I got tired of typing PathComponentPiece{"..."} in tests so here are
some operator literals.

Reviewed By: simpkins

Differential Revision: D7956732

fbshipit-source-id: 85d9f3fd725853a54da9e70fc659bd7eb9e0862c
2018-05-11 14:52:07 -07:00
Chad Austin
04d873a27a add EdenBug::throwException
Summary:
I frequently find myself forgetting how to make the compiler see that
non-moved-from EDEN_BUG's destructor is noreturn, so add a simple
throwException function to it.

Reviewed By: simpkins

Differential Revision: D7834182

fbshipit-source-id: f279b9ca24f90efb4ad3ac318606dbd2dd002665
2018-05-01 16:52:06 -07:00
Adam Simpkins
8e3c09a99a move folly/experimental/logging to folly/logging/
Summary:
Promote the folly logging code out of the experimental subdirectory.
We have been using this for several months in a few projects and are pretty
happy with it so far.

After moving it out of the experimental/ subdirectory I plan to update
folly::Init() to automatically support configuring it via a `--logging` command
line flag (similar to the initialization it already does today for glog).

Reviewed By: yfeldblum, chadaustin

Differential Revision: D7755455

fbshipit-source-id: 052db34c97f7516728f7cbb1a5ad959def2f6efb
2018-04-30 21:29:29 -07:00
Adam Simpkins
dea514bbef add CMake build files
Summary: Add CMakeFiles to build Eden.

Reviewed By: wez

Differential Revision: D7479587

fbshipit-source-id: 7e0b4a756005dadc3af5c13c36ce22d1dcc15071
2018-04-30 14:37:46 -07:00
Chad Austin
1f256dd26e bump takeover receive timeout to five minutes
Summary: Temporary fix to bump the takeover timeout to five minutes

Reviewed By: simpkins

Differential Revision: D7660642

fbshipit-source-id: 5b3a0347aa1443e395e9461d33459c62ffce5b2d
2018-04-18 11:53:01 -07:00
Chad Austin
75b32848c6 refactor UnixSocket in prep for iovec limits
Summary:
UnixSocket traverses the IOBuf chain twice.  Refactor that
into a common function because the next diff caps the size of
individual iovecs.

Reviewed By: simpkins

Differential Revision: D7659062

fbshipit-source-id: 88b7d63669d8189b96434c38a6e499ed3b5ebbe6
2018-04-18 11:31:02 -07:00
Adam Simpkins
19122feb19 add a FOLLY_INIT_LOGGING_CONFIG() helper macro
Summary:
Add a macro to help users define the `getBaseLoggingConfig()` function.

While I would prefer to avoid macros if possible, this seems worthwhile.  This
saves 4 or 5 lines of boilerplate code in each program that sets a custom base
logger setting.  It also reduces the likelihood of a developer accidentally
having a typo in the function name, which would still build successfully but
not have the desired results.

Reviewed By: chadaustin

Differential Revision: D7457652

fbshipit-source-id: 1c316c7ea6949c16bd7b61c0440cc1ee69ecb83e
2018-04-10 11:42:27 -07:00
Adam Simpkins
f5f0f5f9c8 use folly::getBaseLoggingConfig() to set base logging config
Summary:
Set the default logging settings by overriding folly::getBaseLoggingConfig()
rather than by setting a default value for the `--logging` command line
argument.

This has two advantages:
- Custom logging settings supplied in the `--logging` argument will now
  combined with the base logging settings rather than completely replacing
  them.  Previously users had to always add "eden=DBG2" to this argument if
  they did not want to drop this setting.
- This will make it possible to move the definion of the `--logging` flag to
  folly::Init and not lose our custom settings for Eden.

Reviewed By: yfeldblum

Differential Revision: D7348519

fbshipit-source-id: bd9012f387b0460da8bcc9c7c31aef46b1abec5c
2018-03-21 12:37:48 -07:00