Commit Graph

3728 Commits

Author SHA1 Message Date
Genevieve Helsel
9f6c043bfd handle EdenError in checkout path
Summary: EdenFS is planning on throwing an error if a user requests a checkout while a checkout is already in progress. Often, this is already disallowed by a mercurial repository lock, but there are instances where these calls can still get through. We would like to disallow these calls to queue, so we will throw an `EdenError` instead. Without this handling, a full stack trace prints, so this just makes it a bit prettier for the user.

Reviewed By: simpkins

Differential Revision: D20106480

fbshipit-source-id: e33df3d0b7aa42867ee752e4c1f3a47b31ade76b
2020-02-27 07:30:35 -08:00
Jun Wu
2996eeb273 test-commitcloud-backup-all: opt-in DUMMYSSH_STABLE_ORDER
Summary:
Stabilize the test. Without the change it's relatively easy to reproduce
test breakage. For example, the following command reproduces the breakage
within 20 seconds:

```
% ./run-tests.py test-commitcloud-backup-all.t --loop
 --- test-commitcloud-backup-all.t
+++ test-commitcloud-backup-all.t.err
@@ -45,10 +45,10 @@

   $ hg cloud backup --traceback
   backing up stack rooted at 64164d1e0f82
+  backing up stack rooted at d0d71d09c927
   remote: pushing 2 commits:
   remote:     64164d1e0f82  A1
   remote:     796f1f48de85  B
-  backing up stack rooted at d0d71d09c927
   remote: pushing 2 commits:
   remote:     d0d71d09c927  A2
   remote:     daeeb2f180d6  C

ERROR: test-commitcloud-backup-all.t output changed
[====================] 47 Passed. 1 Failed. 0 Skipped. -48 Remaining        16.2s
[------------>       ] test-commitcloud-backup-all.t                        1.8s
```

Reviewed By: xavierd

Differential Revision: D19872613

fbshipit-source-id: 4b6a48e2c8987ec0fded73a5b88430c1df1f6fb7
2020-02-27 07:24:37 -08:00
Jun Wu
a5066dd552 dummyssh: add a way to stabilize stdout, stderr order
Summary:
The ssh output order issue is a large contributor to test flakiness.
Example test failures are:

```
 --- test-unbundlereplay.t
+++ test-unbundlereplay.t.respondfully.err
@@ -154,9 +154,9 @@
   remote: [ReplayVerification] Expected: (master_bookmark, c2e526aacb5100b7c1ddb9b711d2e012e6c
69cda). Actual: (master_bookmark, 893d83f11bf81ce2b895a93d51638d4049d56ce2)
   remote: pushkey-abort: prepushkey hook exited with status 1
   remote: transaction abort!
+  replay failed: error:pushkey
+  unbundle replay batch item #0 failed
   remote: rollback completed
-  replay failed: error:pushkey
-  unbundle replay batch item #0 failed
   [1]
   $ cat $TESTTMP/reports.txt
   unbundle replay batch item #0 failed

 --- test-commitcloud-backup-all.t
+++ test-commitcloud-backup-all.t.err
@@ -59,9 +59,9 @@
   remote: pushing 1 commit:
   remote:     eccc11f58a56  D3
   backing up stack rooted at 42952ab62cec
+  backing up stack rooted at 4903fdffd9c6
   remote: pushing 1 commit:
   remote:     42952ab62cec  E1
-  backing up stack rooted at 4903fdffd9c6
   remote: pushing 1 commit:
   remote:     4903fdffd9c6  E2
   commitcloud: backed up 8 commits

test-fb-hgext-lfspushrebase-verify-blobs.t

 --- test-fb-hgext-treemanifest-pushrebase.t
+++ test-fb-hgext-treemanifest-pushrebase.t.err
@@ -127,9 +127,9 @@
   $ hg push --to master -B master --config treemanifest.sendtrees=True
   pushing to ssh://user@dummy/master
   searching for changes
-  remote: baz
   remote: prepushrebase.cat hook exited with status 1
   abort: push failed on remote
+  remote: baz
   [255]

 - Disable the hook
 ```

The order is nondeterministic because the stderr reading thread can read the
content before or after ui.write or ui.write_err in the main thread.

This diff introduces an optional feature in dummyssh that buffers all stderr
output and only write them after the wrapped hg serve process has exited, at
which time the hg client should also have completed its operations and has no
reason to ui.write or ui.write_err anything nondeterministically. Then the
dummyssh wrapper writes out the buffered stderr so the output order becomes
well defined.

Reviewed By: xavierd

Differential Revision: D19872612

fbshipit-source-id: 84710f98a8e6b4a1c283ffecf008585cca12be0a
2020-02-27 07:24:37 -08:00
Jun Wu
c8157cc25a dummyssh: format it
Summary: This makes the next change easier to see.

Reviewed By: xavierd

Differential Revision: D19872609

fbshipit-source-id: 9263a246258ffd18d8d883da7ced435a91fb5ced
2020-02-27 07:24:37 -08:00
Kostia Balytskyi
7ee657f124 mononoke: asyncify signatures of two fns in getbundle_response
Summary:
## Wider goal
See D20068839

## This diff
Asyncifying only singatures allows us to independently work on function bodies, without touching the callsites later in the diff.

Reviewed By: StanislavGlebik

Differential Revision: D20097804

fbshipit-source-id: f1391a055947c7802f719bc99b9eae71a4ac39cd
2020-02-27 05:01:52 -08:00
Kostia Balytskyi
bd90a843a7 mononoke: asyncify diff_with_parents in getbundle_response
Summary:
## Wider goal
See D20068839

## This diff
Let's modernize this particular fucntion

Reviewed By: StanislavGlebik

Differential Revision: D20097800

fbshipit-source-id: a919b5ad1b544a7b784668ca265e24c375100fa3
2020-02-27 05:01:51 -08:00
Kostia Balytskyi
90b03f5a0d mononoke: call old-style Future OldFuture in getbundle_response
Summary:
## Wider goal
See D20068839

## This diff
This file contains a mix of old and new-style futures. It even has futures,
which have items composed of futures. To be able to convert on one of the
levels and not the other, we need to deal with the confusion.

Let's have old things have `Old` in the name.

Reviewed By: StanislavGlebik

Differential Revision: D20097803

fbshipit-source-id: fedb3669ef34a8328ec389a30ff2c512ab363818
2020-02-27 05:01:51 -08:00
Kostia Balytskyi
4f2993c765 mononoke: move bundle generation bits from hg_sync_job into getbundle_response
Summary:
## Wider goal
We want the flexibility to return hydrated responses for `getbundle` wireproto
requests for draft commits. This means that the responses will contain not
only the commit data (as they do now), but also trees and files.
For context, when an "unhydrated" response is returned for the `getbundle`
request for a draft commit, we expect one of two things to happen later
in the e2e scenario:
- either `hg` client would immediately make another wireproto request
  (`gettreepack`, `getpackv1`) within the same client `hg` command execution
- or a subsequent `hg update` call will cause another wireproto request

In any case, another request is needed before the pulled commit can be used.
This request can hit a different server, sometimes it can even be Mercurial
instead of Mononoke. Specifically, it can Mercurial instead of Mononoke if the
`fallback` path markers are configured incorrectly. In that case we have a
problem, as Mercurial is incapable of serving `gettreepack` or `getpackv1` for
infinitepush commits.

One way to deal with this is to always have correct path markers, which is
prone to human mistakes. Another way is to guarantee that Mononoke returns
everything in the original `getbundle` request. We don't want to do this for
public commits, as `pull`s of public commits typically fetch thousands of those
commits and never care about tree or file data for all but one of them. Draft
commits are different however, as they are usually exactly what the client
intends to use, so hydrating those is fine. Still, we want this behavior to
be gated behind a config flag.

## This diff
A lot of the needed code is already implemented in the hg-sync job, bundle
generating variant. So prior to implementing the actual behavior described
above, let's move the relevant bits to `getbundle_response`. Later we can comb
them up a bit (asyncify) and use to implement the needed behavior.

Reviewed By: StanislavGlebik

Differential Revision: D20068839

fbshipit-source-id: 0ab63d57b2d167401b7ee8864fe7760f5f65f8ec
2020-02-27 05:01:51 -08:00
Kostia Balytskyi
aac7bff59d mononoke: pull config schema changes from configerator
Summary:
This is the moral equivalent of D20115877 in fbcode. See that diff for
motivation.

Reviewed By: StanislavGlebik

Differential Revision: D20118575

fbshipit-source-id: 8f77f572068e611003b1344be3434f2d04ec56ca
2020-02-27 05:01:50 -08:00
Stanislau Hlebik
d5d3061168 mononoke: distinguish derived data waits with derived data generation
Summary:
Previously it was hard to tell whether the process were actually responsible
for generating derived data or it was just waiting for it to be generated.

Let's make this distinction clearer.

Reviewed By: johansglock

Differential Revision: D20138284

fbshipit-source-id: 52ae12679db2f61869f048baf2a603b456710a71
2020-02-27 03:15:39 -08:00
Adam Simpkins
3d1962ec1e add a context manager API TelemetrySample
Summary:
Add `__enter__()` and `__exit__()` methods to `TelemetrySample` so it can be
used in `with` statements.  It will automatically track the runtime for the
body of the `with` context, and will record this in the `duration` field of
the sample.  It will also set the `success` field to True if the context exis
normally and False if it exits due to an exception.  On an exception the
`error` field will also be populated with the exception message.

Reviewed By: genevievehelsel

Differential Revision: D20112723

fbshipit-source-id: d55ac3f1b53c23dc001f92a4f8eae431db8954e1
2020-02-26 21:18:11 -08:00
Adam Simpkins
8ec16c8413 add TelemetryLogger that logs directly using scubadata_py3
Summary:
Add a TelemetryLogger class that logs directly to scuba, and use that if we
are building in a Facebook environment.

Reviewed By: genevievehelsel

Differential Revision: D20112727

fbshipit-source-id: 284ca45d1902d51b753ff9a90debf3dfa8282f82
2020-02-26 21:18:11 -08:00
Adam Simpkins
2557cebfd7 add a TelemetryLogger interface
Summary:
Add a `TelemetryLogger` class that abstracts the mechanism we use to log
telemetry samples.  This makes it possible to plug in alternative
implementations.

This includes 3 initial implementations of this class:
* `ExternalTelemetryLogger` logs samples by calling an external command
* `LocalTelemetryLogger` logs JSON samples to a local file
* `NullTelemetryLogger` simply discards all samples

This also moves some of the helper code for constructing telemetry samples
from the `EdenInstance` class and into `TelemetryLogger`.

Reviewed By: genevievehelsel

Differential Revision: D20112725

fbshipit-source-id: dbe24952a92fe548631fc169f146cc14008a7bb6
2020-02-26 21:18:10 -08:00
Adam Simpkins
0642f1618d report the fb303 status in the getDaemonInfo() result
Summary:
Update the thrift `getDaemonInfo()` call to also return the fb303 status.
This allows the CLI to make a single thrift call instead of 2 when checking if
the EdenFS daemon is healthy.

Reviewed By: genevievehelsel

Differential Revision: D20130406

fbshipit-source-id: 9d25341e1d5f82fb1a921e1d7b1ebd34bcf19dc8
2020-02-26 21:03:52 -08:00
Adam Simpkins
436b5bb258 fix thrift timeouts in eden restart
Summary:
Fix the `check_health()` function to always set a timeout when querying for
EdenFS's health.  Originally we used to always set a default timeout of 60
seconds when creating thrift connections to EdenFS, but this was removed in
D5942205.  In practice we ideally really want a handful of specific thrift
calls (e.g., 'checkOutRevision()`, `getScmStatusV2()`) to have extremely high
timeouts, but most other calls should have fairly short timeouts.

For now this ensures that we apply a 3 second timeout by default when checking
for EdenFS health.  The `edenfsctl status` call did explicitly set a 15 second
timeout, but other commands like `edenfsctl clone` and `edenfsctl restart`
would also check for health and were not applying their own timeout.

Also add thrift timeout for the `initiateShutdown()` call when doing a full
restart in `edenfsctl restart`

Reviewed By: chadaustin

Differential Revision: D20130405

fbshipit-source-id: c59118dbcafc2ed0d29206e33891f1a58da8c05f
2020-02-26 21:03:52 -08:00
Michael Devine
0a46a14017 Repo converter: New class "repomanifest"
Summary:
Right now, all of our manifest parsing and evaluation is in the repo() class, but this is a design mistake. Over a repo's convert lifetime, a single repo will have many different manifests, based on branch, and location in the commit history. What's worse is that the current design makes it hard to build unit tests and new features like include evaluation.

This commit creates a whole new class called repomanifest, that represents a specific manifest (and its included files). It also has unit tests to test the various operations that the manifest performs, such as path and revision mapping. This commit does not modify the existing converter code outside of the class to use this new implementation.

Reviewed By: tchebb

Differential Revision: D19402995

fbshipit-source-id: b97dadcc595c6332f4495460618317194873a780
2020-02-26 17:25:22 -08:00
Jun Wu
251fe1b775 sshpeer: always read all stderr messages
Summary:
In the past I saw test breakages where the stderr from the remote ssh process
becomes incomplete. It's hard to reproduce by running the tests directly.
But inserting a sleep in the background stderr thread exposes it trivially:

```
# sshpeer.py:class threadedstderr
     def run(self):
         # type: () -> None
         while not self._stop:
             buf = self._stderr.readline()
+            import time
+            time.sleep(5)
             if len(buf) == 0:
                 break
```

Example test breakage:

```
 --- a/test-commitcloud-sync.t
+++ b/test-commitcloud-sync.t.err
@@ -167,8 +167,7 @@ Make a commit in the first client, and sync it
   $ hg cloud sync
   commitcloud: synchronizing 'server' with 'user/test/default'
   backing up stack rooted at fa5d62c46fd7
   remote: pushing 1 commit:
-  remote:     fa5d62c46fd7  commit1
   commitcloud: commits synchronized
   finished in * (glob)
....
```

Upon investigation it's caused by 2 factors:
- The connection pool calls pipee.close() before pipeo.close(), to workaround
  an issue that I suspect solved by D19794281.
- The new threaded stderr (pipee)'s close() method does not actually closes the
  pipe immediately. Instead, it limits the text to read to one more line at
  most, which causes those incomplete messages.

This diff made the following changes:
- Remove the `pipee.close` workaround in connectionpool.
- Remove `pipee.close`. Embed it in `pipee.join` to prevent misuses.
- Add detailed comments in sshpeer.py for the subtle behaviors.

Reviewed By: xavierd

Differential Revision: D19872610

fbshipit-source-id: 4b61ef8f9db81c6c347ac4a634e41dec544c05d0
2020-02-26 17:08:23 -08:00
Jun Wu
7f38170116 sshpeer: call cleanup on close
Summary:
This makes `peer.close()` actually close the ssh connection if it's an
sshpeer. This affects the `clone` path to actually clean up the ssh connection
so we don't depend on (fragile) `__del__`.

I traced the code back to peerrepository.close in 2011 [1]. At that time it
seems the codebase depends on `__del__`. Nowadays the codebase calls `close()`
properly so I think it's reasonable to make the change.

[1]: https://www.mercurial-scm.org/repo/hg/rev/d747774ca9da.

Reviewed By: ikostia

Differential Revision: D19911393

fbshipit-source-id: ea640d1cd82ffcb786e22f47da8116c7f50a4690
2020-02-26 17:08:23 -08:00
Jun Wu
6465cda913 clone: add a "clonepreclose" function
Summary:
The added function can be used by extensions to run extra logic before the
"clone" function closes the repos or peers.

This is needed to make the next diff work. Otherwise extensions like remotenames will try to write to a closed sshpeer and cause errors.

Reviewed By: DurhamG

Differential Revision: D19911390

fbshipit-source-id: ca1364e808cebb632e051fbbdcfe4bf0dca721bc
2020-02-26 17:08:23 -08:00
David Tolnay
de96589260 autocargo: Strip line comments
Summary:
These comments end up being a source of churn as we roll out D20125635, and anyway are not particularly meaningful after the transformations performed by autocargo. For example:

```
bytes = { version = "0.4", features = ["serde"] } # todo: remove
```

^ This doesn't mean the generated Cargo.toml intends to drop its bytes dependency altogether, but just that will be migrated to a different version that is present in the third-party/rust/Cargo.toml but not visible in the generated Cargo.toml.

Reviewed By: jsgf

Differential Revision: D20128612

fbshipit-source-id: a9e7b29ddc4b26bc47a626dd73bdaa4771ee7b18
2020-02-26 16:31:52 -08:00
Stanislau Hlebik
98f6d5d1a8 mononoke: fix walker filenode walks
Summary:
Since Mononoke's filenodes were migrated to derived data framework
hg_linknode_populated alarm has been firing. The main reason was that there's
now a delay between hg changeset being generated and filenodes being generated.

This diff fixes it by making sure walker won't visit hg changesets without
generated filenodes (note that walker will visit these changesets later after filenodes will be
generated).

Reviewed By: ahornby

Differential Revision: D20067615

fbshipit-source-id: 285e9a3d8c89b85441491c889a8458c86ca0e3a8
2020-02-26 15:21:53 -08:00
Adam Simpkins
0ffcf3e450 update the Rust print_status() function to take an IO parameter
Summary:
Update the `print_status()` function to take a `clidispatch::io::IO` object as
a parameter, instead of a simple output object.  This will allow us to also
print error messages from this function in a future diff.

Reviewed By: quark-zju

Differential Revision: D19958504

fbshipit-source-id: bf482fdc4420e1350363a730c6a539cd760aef25
2020-02-26 14:54:40 -08:00
Durham Goode
430f047eda py3: fix flat dirstate parsing/packing
Summary: Updates the C code to support unicode filenames and states.

Reviewed By: simpkins

Differential Revision: D19786275

fbshipit-source-id: e7aeb029b792818b1b1a9c5d3028640b56522235
2020-02-26 12:53:25 -08:00
Xavier Deguillard
76dd52a310 infinitepush: only open a transaction when deleting bookmarks
Summary: There is no need to open a transaction otherwise.

Reviewed By: DurhamG

Differential Revision: D20109840

fbshipit-source-id: e47adaaeea2d7565f3629701d8de4a67d4b55182
2020-02-26 10:27:05 -08:00
Durham Goode
f188acb4e0 recover: don't verify the repo
Summary:
Verifying the changelog is quite slow and we've had more users needing
to run hg recover these days. Let's finally get rid of the verify step.

Reviewed By: simpkins

Differential Revision: D20109706

fbshipit-source-id: a512d9e11716514bce986b0e3a26347fe6afd955
2020-02-26 09:07:08 -08:00
Aida Getoeva
8f09d5a51b hg-py3: fix the last amend commands
Summary: Most of the fixes related to encoding in `patch.py`

Reviewed By: DurhamG

Differential Revision: D19713378

fbshipit-source-id: 66ccbd0fc7826ab2d4c05173c7e9edb96700d106
2020-02-26 08:26:13 -08:00
Aida Getoeva
585899f419 mononoke/scs: use last change in file history
Summary:
There is no need to generate expensive file history stream if only one node is requested.

I refactored code that generated stream of history commits, so it'd first yield the nodes and only then prefetch their parents. That will help to solve latency problem for the history request for only a single commit.

I removed BFS queue and added two state variables: ready nodes and already processed:
* The last are the nodes that were return as a part of a history stream on the last iteration and now can be used to construct next BFS layer: prefetch fastlog batches, fill the commit graph, take parents in BFS order to form new bunch of nodes.
* First are used if it's the first iteration - there is no processed nodes yet but there are some that are ready to be returned.

I believe removing the queue I simplified the code and logic a little bit.

Reviewed By: StanislavGlebik

Differential Revision: D19818100

fbshipit-source-id: c30d28c623464ba3552a00e8542552f7655076ef
2020-02-26 08:09:12 -08:00
Alex Hornby
04e011525a mononoke: walker: test validate scuba logging for non-public commits
Summary: add test for scuba logging for non-public commits

Reviewed By: StanislavGlebik

Differential Revision: D20093721

fbshipit-source-id: eb0792bcae8ea27c11709181390efb0ac0c817ee
2020-02-26 06:16:29 -08:00
Stanislau Hlebik
7076fac933 mononoke: add exponential backoff
Summary:
During our tests we noticed that we can send too many blobstore read requests to the
mapping. Let's add exponential backoff to prevent that

Reviewed By: ikostia

Differential Revision: D20116043

fbshipit-source-id: 6fecbda4c36a5065b77ba9df561c6d9c6a969089
2020-02-26 05:05:33 -08:00
Thomas Orozco
4ca1333b8a mononoke/hooks: use a smaller test group for faster tests
Reviewed By: ikostia

Differential Revision: D20115985

fbshipit-source-id: 4f69fc84eee352bcc689918527c6d460fcf672ba
2020-02-26 04:44:39 -08:00
Thomas Orozco
c14a88bbef mononoke: convert places that talk to Memcache to Bytes 0.5
Summary:
Memcache doesn't care (because both old and new Bytes to `Into<IOBuf>`), but
Thrift is Bytes 0.5. We have our caching ext layer in the middle, which wants
Bytes 0.4. This means we end up copying things we don't need to copy.

Let's update to fewer copies. I didn't update apiserver, because a) it's going
away, and b) those bytes go into Actix, and Actix isn't upgrading to Bytes 0.5
any time soon! Besides, this doesn't actually need updating besides tests anyway.

Reviewed By: dtolnay

Differential Revision: D20006062

fbshipit-source-id: 42766363a0ff8494f18349bcc822b5238e1ec0cd
2020-02-26 03:30:47 -08:00
Adam Simpkins
08f86af0a4 enable strict type checking in telemetry.py
Summary: Enable `pyre-strict` mode in eden/cli/telemetry.py

Reviewed By: genevievehelsel

Differential Revision: D20102260

fbshipit-source-id: 0e5030f99852eb07dc427ba80cc30334adea4bfb
2020-02-25 19:01:10 -08:00
Adam Simpkins
f0cf7fec98 update the telemetry wrapper to log the current code version
Summary:
Add methods to `version.py` to get the version of the current running Eden CLI
code, rather than looking for the current installed RPM version.  This means
that we no longer have to execute a separate subprocess that examines the RPM
database.  This also makes sure we log the correct version information in
cases where developers are testing local development code even though they
have a different RPM version currently installed.

Reviewed By: genevievehelsel

Differential Revision: D20102259

fbshipit-source-id: ba9eb0c563c7f7c929170b130566946a67f679a5
2020-02-25 19:01:10 -08:00
Adam Simpkins
9ee7b23604 update RPM version code to return Optional[Tuple[str, str]]
Summary:
Update `get_installed_eden_rpm_version_parts()` to simplify the return type
from `Tuple[Optional[str], Optional[str]]` to `Optional[Tuple[str, str]]`

This also improves the output of `get_installed_eden_rpm_version()` when the
RPM is not installed so that it returns `<Not Installed>` rather than
`<Not Installed>-` with a trailing dash.

Additionally this updates the telemetry logging to include the full
version+release string.  With our current version number scheme there can be
multiple packages with the same version but different release numbers if we
release multiple packages within a single day.

Reviewed By: genevievehelsel

Differential Revision: D20102263

fbshipit-source-id: 24d2df4cdca6ac576267be66b85422c3e50f1229
2020-02-25 19:01:09 -08:00
Adam Simpkins
4ee1a29578 move code to get the running EdenFS version to EdenInstance
Summary:
Move the `get_running_eden_version()` functions from the `version.py` module
into the `EdenInstance` class in `config.py`.  This helps eliminate some
circular dependency cycles in the code, so I can start breaking a few modules
out of the main CLI `lib` library.

I also changed the return type of `get_running_version_parts()` from
`Tuple[Optional[str], Optional[str]]` to just `Tuple[str, str]`.  A dev build
of EdenFS already returns empty strings (rather than `None`) for the version
and release fields).  There shouldn't really be any cases where `None` is
returned here, and even if there were I don't think we would ever care to
distinguish this from the empty string case.

Reviewed By: genevievehelsel

Differential Revision: D20102262

fbshipit-source-id: 564ec5ee820026a0c86c70ad0d7cfd3750ad94f5
2020-02-25 19:01:09 -08:00
Genevieve Helsel
35c8305d13 scuba logging eden full restart
Summary: Log when a user runs a normal (full) restart, including success or not. Success is determined by the return code of `start_daemon()` (which calls `subprocess.call()`), similar to the success critera for graceful restart logging

Reviewed By: fanzeyi

Differential Revision: D20098949

fbshipit-source-id: 0c6f4927571f686ed6b678d5c814f76c78322274
2020-02-25 15:31:44 -08:00
Genevieve Helsel
0c908acc0d scuba logging eden doctor calls
Summary: log when a user runs eden doctor, and log how many errors they encounter

Reviewed By: fanzeyi

Differential Revision: D20084617

fbshipit-source-id: 122a062c538931eb906cbfcd515ec1e8093efc38
2020-02-25 15:31:43 -08:00
Genevieve Helsel
88851bc88d add no-op logging to FakeEdenInstance
Summary: This is required for eden doctor cli tests when adding logging to the eden doctor code path. This can just be a stub since we don't consume these scuba log statements during testing

Reviewed By: fanzeyi

Differential Revision: D20087861

fbshipit-source-id: 6805ae8d9c51e33a118cbda76461483962e876f3
2020-02-25 15:31:43 -08:00
Genevieve Helsel
0528daf796 add type annotation in check_filesystems
Summary: the TypeCheck test cases were yelling at me because of this annotation missing when running locally, so adding it to fix those tests.

Reviewed By: fanzeyi

Differential Revision: D20098619

fbshipit-source-id: 630e7bca2b63033b34d72d1c739184819d3d86a3
2020-02-25 15:31:43 -08:00
Jeff Zhang
33140b117c Push compat down one level in eden/mononoke/cmds/admin/main.rs
Summary: Moving `compat` one level down to the call sites of subcommand functions.

Reviewed By: farnz

Differential Revision: D20085398

fbshipit-source-id: 461e147d2ae6e560b3a75fb92fa6b23f9f54d13e
2020-02-25 10:22:03 -08:00
Zeyi (Rice) Fan
2222dbc1a5 fix HgPrefetchTest
Summary:
The problem is that the datapack files are not flushed to disk when it is prefetched. By having a pair of brackets around the `HgBackingStore`, it will ensure the `HgImporter` is closed by the time when we verify the prefetch with `hg cat` since it will terminate the `debugedenimporthelper` process in its destructor, which flushes the datapack files.

The real cause of the test failure is still unclear but I believe this is the correct way of doing this test.

Reviewed By: xavierd

Differential Revision: D20090249

fbshipit-source-id: 8e3966936a402c92311919433282027846d065e8
2020-02-25 10:14:29 -08:00
Puneet Kaushik
2b19eb7c17 Define directory types for Windows
Summary: Windows SDK doesn't define dirent. Defining it here for adding Inodes support on Edenfs on Windows.

Reviewed By: simpkins

Differential Revision: D19956272

fbshipit-source-id: 1bdf9a7563c194fe38008741b09668242ffa64ee
2020-02-25 10:14:29 -08:00
Puneet Kaushik
ca40c6f0f4 Update log level and remove async
Summary:
Logging on Windows doesn't work when the async is set. We haven't debugged it yet. Removing the async mode flag until we fix that.

Also bumping up the log level to 4. This would help to get more info while we are running in beta.

Reviewed By: simpkins

Differential Revision: D19776609

fbshipit-source-id: ccd6a6ed4d81f4a2edd550c6bb7195ac8b8b4d16
2020-02-25 10:14:28 -08:00
Stanislau Hlebik
19e1e94984 mononoke: add lease renewing to derived data
Summary:
During S196197 lease expired and we were rederiving the same derived data over and over again for a big commit.
this diff adds lease renewal that should help with this problem.

Reviewed By: HarveyHunt

Differential Revision: D20093323

fbshipit-source-id: d139abf6659722f47ea40d9b2f279daa03623ff4
2020-02-25 09:22:46 -08:00
Stanislau Hlebik
4bd758289b mononoke: async/await derive_may_panic() function
Reviewed By: HarveyHunt

Differential Revision: D20092945

fbshipit-source-id: 70ec1a8e5b9c99f3853a13bebe3657ece5ff9e9e
2020-02-25 09:22:46 -08:00
Genevieve Helsel
887de5105d scuba log eden rage calls
Summary: log when a user runs eden rage

Reviewed By: simpkins

Differential Revision: D20084529

fbshipit-source-id: a92c5472554cd541c9a7d340edcf6845c1c9c0c0
2020-02-25 08:11:28 -08:00
Stanislau Hlebik
3418318883 mononoke: do not generate hgchangesets unnecessarily in FilenodesOnlyPublicMapping
Summary:
fetch_root_filenode is called by FilenodesOnlyPublicMapping to figure out if
filenodes were already derived. Previously it first derived hg changeset and
then fetched looked up root manifest in db. However if hg changeset is not
derived then filenodes couldn't possible be derived either and we can return an
answer faster.

This is useful in the next diff where I change walker

Reviewed By: ahornby

Differential Revision: D20068819

fbshipit-source-id: 17f066c437e0b1f7bbeb8f6e247eadc9afe94f90
2020-02-25 08:07:07 -08:00
Thomas Orozco
f8fcbc9723 mononoke/blobstore_healer: wait for MyRouter properly
Summary:
The blobstore_healer has never waited for MyRouter before querying for slave
status, but it ended up implicitly working because creating a blobstore
required a SQL factory, and creating a SQL factory would result in waiting for
MyRouter.

Now that creating a blobstore doesn't require SQL factory unless you're going
to actually use it (which the healer isn't: it doesn't use a multiplexblob, it
uses the underlying blobstores instead), we no longer wait properly for
MyRouter, so if MyRouter isn't there when we boot, we crash.

This fixes that.

Reviewed By: ahornby

Differential Revision: D20094829

fbshipit-source-id: 82b7e8d893a01049d1f434ee8dff36a877a0d2f4
2020-02-25 07:03:28 -08:00
Alex Hornby
693e8dee0a mononoke: walker: add support for loading by GitSha1 Aliases
Summary:
Add support for loading by GitSha1 Aliases.  This relies on the change to
Alias::GitSha1 earlier in stack.

Reviewed By: ikostia

Differential Revision: D19903577

fbshipit-source-id: 73cdccc04af61fa524c3683851d8af9ae90d31dc
2020-02-25 03:36:06 -08:00
Adam Simpkins
ef04ccf546 replace a bunch of pyre-fixme comments with pyre-ignoree
Summary:
D17135557 added a bunch of `pyre-fixme` comments to the EdenFS integration
tests for cases where Pyre cannot detect that some attributes are initialized
by the test case `setUp()` method.

It looks like Pyre's handling of `setUp()` is somewhat incorrect: it looks
like if a class has a `setUp()` method this currently suppresses all
uninitialized attribute errors (even if some attributes really are never
initialized).  However, Pyre does not detect `setUp()` methods inherited from
parent classes, and always warns about uninitialized attributes in this case
even they are initialized.

Lets change these comments from `pyre-fixme` to `pyre-ignore` since this
appears to be an issue with Pyre rather than with this code.  T62487924 is
open to track adding support for annotating custom constructor methods, which
might help here.  I've also posted in Pyre Q&A about incorrect handling of
`setUp()` in derived classes.

Reviewed By: grievejia

Differential Revision: D19963118

fbshipit-source-id: 9fd13fc8665367e0780f871a5a0d9a8fe50cc687
2020-02-24 18:55:19 -08:00