Commit Graph

56999 Commits

Author SHA1 Message Date
Xavier Deguillard
ffc487e2de color: do not try to enable VT mode for tests
Summary:
Tests are redirected, but we still want colors in them (to verify that ANSI
escape code works). Since VT mode will always fail, simply do not try to
enable it in this case.

Reviewed By: DurhamG

Differential Revision: D20875423

fbshipit-source-id: bd6b0046de9558d957e0df082d4392ad00e0b551
2020-04-06 13:07:52 -07:00
svcscm
8dece4d4ae Updating submodules
Summary:
GitHub commits:

3948ca5280
6e15cc00fc
35bb5f2911
fb0b6b1cc4

Reviewed By: zpao

fbshipit-source-id: 5ee3095c2c5933b8c2b62af99b65700a9cadf773
2020-04-06 12:41:48 -07:00
Katie Mancini
0137a8ccb4 Explicitly track current/pending imports -- add current metrics
Summary:
Previously `eden top` shows metrics for imports that are queued
and fetching data (though there is a bug here fixed above), we
want to provide more granularity to help with debugging:

This explicitly separates "current" and "pending" imports:
- "live": The import is live, ie it is currently importing data
  - having this metric allows debugging the case that there
is a problem fetching data
- "pending": The import is queued, live, or getting data from the
cache
  - having this metric allows debugging the case that there is a
problem initiating the request, for example a request is being
starved on the queue

**note**: I moved the watches closer to the import function call
instead of renaming the currently broken pending import watches
to make it more clear in the code what these are suppose to be
timing

Reviewed By: chadaustin

Differential Revision: D20629833

fbshipit-source-id: 84ef75057149a648a51418a5cc93be87e3b3d6b5
2020-04-06 11:45:58 -07:00
Xavier Deguillard
46d13ee650 ui: cache formatted
Summary:
Somehow the constant isatty and config reading shows up in my profile. Since
this is not intended to change, just cache it.

Reviewed By: DurhamG

Differential Revision: D20830511

fbshipit-source-id: de36c0a958f6a6046a05db0abf976994435b9e3c
2020-04-06 11:10:53 -07:00
Xavier Deguillard
1ece50fc62 tests: fix test-fb-hgext-remotefilelog-rust-lfs.t on Windows
Summary:
The IndexedLog code uses a lock file to lock a directory on Windows, make
sure we account for that.

Reviewed By: DurhamG

Differential Revision: D20818882

fbshipit-source-id: 7e9aa255354d36899ad57168311a4276d448dc07
2020-04-06 10:18:05 -07:00
Alex Hornby
d7be844de5 mononoke: add default implementations for samplingblobs put and is_present handlers
Summary: Add default implementations for samplingblobs put and is_present handlers to save some boilerplate

Reviewed By: farnz

Differential Revision: D20868507

fbshipit-source-id: 40275cc832870019238c0635e097e53671b76783
2020-04-06 10:01:38 -07:00
Mateusz Kwapich
4163e2937f use operation keys for selects
Summary:
This way we'll never select more than (no_of_stores * limit) rather than
potentially unbounded output.

NOTE: This diff has to be landed and rolled out **after** D20557702 is rolled out. I'm assuming that after some time since D20557702 rollout  all the rows in the production db will have proper `operation_key` value set so we can make queries based on them.

Reviewed By: krallin

Differential Revision: D20557700

fbshipit-source-id: 5a1d4b69949b425915214f5227c5c0dcce374360
2020-04-06 09:57:24 -07:00
Mateusz Kwapich
549eb41059 run blobstore healer integration test with mysql
Summary: So we're sure that all the quries work not only in sqlite.

Reviewed By: krallin

Differential Revision: D20839958

fbshipit-source-id: 9d05cc175d65396af7495b31f8c6958ac7bd8fb6
2020-04-06 09:57:24 -07:00
Mateusz Kwapich
975ddc043f test showing the problem with repeating blob_keys
Summary:
When we have more entries with a single blobkey we always select all of them
regardles when and how they were added. That's why we need to select basing on
operation_key.

Reviewed By: krallin

Differential Revision: D20557699

fbshipit-source-id: 77ccf992bb24d1a46ea28a13ab0780e6c92935ae
2020-04-06 09:57:24 -07:00
Xavier Deguillard
ed68d04942 pyworker: no longer ignore windows file removal failures
Summary:
Now that we have a proper back-channel to retry failures in Python, the
failures will be retried at a later time, when the anti-virus would have
hopefully release any locks it has on the file.

Reviewed By: DurhamG

Differential Revision: D20847006

fbshipit-source-id: 4fad0e773f69ddff27a23bc86dbbd3ce47bb3b46
2020-04-06 09:49:52 -07:00
Xavier Deguillard
d0b63fcd01 color: only warn about VT mode when formatted
Summary: We don't want tests to show this warning.

Differential Revision: D20851847

fbshipit-source-id: bae87a980a2da4088aff6ed0b4a3a85971166817
2020-04-06 08:48:58 -07:00
svcscm
b12bcdc6eb Updating submodules
Summary:
GitHub commits:

f2cb0bd51a
1e81260e6a
761f1ebb89

Reviewed By: yns88

fbshipit-source-id: a34ef55fc9ee2798ed05ba34d98871884b9b3a4e
2020-04-06 08:26:51 -07:00
Thomas Orozco
0565c7e244 hggit: add a external-sync command that does the bare minimum
Summary:
For our HgExternalSync jobs that pull from git, we don't really use most of the
bells and whistles of hggit. Notably, we don't care about bookmarks: we only
ever pull master, we never update to it, we only ever look at `-r tip`.

However, we do care about things that are actually much harder to fit in a
world where we try to pretend the remote git repository is actually a hg
repository we can pull from.

Notably, we'd like to enforce limits on how many commits we pull (and convert)
at a time, so that if we fall behind a little bit, we don't start falling even
more behind by having to convert bigger and bigger batches of commits. If we're
trying to pretend fetching from git and converting commits is actually a pull,
then that seems harder to pull off (we'd need to somehow rewind the remote head
we're pulling before importing it).

So, this adds a new external-sync command to hggit that basically the bare
minimum that we do need. It lets you specify a git remote and a head you care
about, and import up to N commits from it. That's it — no bookmarks are updated
or anything (but the git-mapfile is, of course). The only thing that changes is
your commits.

If you actually want to interact with your git repository on an ongoing basis
as if it were a remote hg repository, this is completely useless, but that
isn't what we actually do, so that should be OK.

As part of this, I've modified a few other parts of git_handler to remove
places where we called a `uri` `remote_name` (which is a bit confusing), and a
place where we were asking for a `remote_name` parameter that I don't have
here, but which we also didn't actually need (in `import_git_objects`).

Reviewed By: farnz

Differential Revision: D20836601

fbshipit-source-id: 96230e6e8269d0472404414948fd2f02aa98d79c
2020-04-06 07:35:36 -07:00
Mark Thomas
5456adefe7 infinitepush: don't create revive obsmarkers if evolution is not enabled
Summary:
Evolution crashes if you try to create obsmarkers in a repo where obsmarkers
are not enabled.  Instead, check before reviving commits with obsmarkers that
it is enabled.

Reviewed By: krallin

Differential Revision: D20868173

fbshipit-source-id: b3a08ef05ddc13e9b78df8ac7c1ca1ef808b7602
2020-04-06 06:43:35 -07:00
Alex Hornby
ba8e6e0d1c mononoke: walker: log errors to scuba regardless of the error_as_data setting
Summary: Log errors to scuba regardless of the error_as_data setting, as as finding the logs is much easier from scuba than stderr.

Reviewed By: farnz

Differential Revision: D20838462

fbshipit-source-id: b78e3a3213ed4aee4e4b2feb871ad7e42e25ed00
2020-04-06 03:17:40 -07:00
svcscm
e00faa7981 Updating submodules
Summary:
GitHub commits:

d00b7d3edd
8b382f3ece

Reviewed By: yns88

fbshipit-source-id: 8342135b4e8db4b5f66b07f3dc5be0511aabfaf7
2020-04-06 03:17:39 -07:00
svcscm
c8cd810cfa Updating submodules
Summary:
GitHub commits:

c03e42ef6a
c1908b5b9e
64580645d0

Reviewed By: yns88

fbshipit-source-id: bd7c30f0e7c42a621af317bfc874c37977a3c24d
2020-04-05 18:23:40 -07:00
svcscm
e1c7cfc51f Updating submodules
Summary:
GitHub commits:

206dd68f59

Reviewed By: yns88

fbshipit-source-id: 5c8d56cbcc0f38836c2573c697f26ce26d3c35f1
2020-04-04 21:23:27 -07:00
svcscm
ca121fb9b5 Updating submodules
Summary:
GitHub commits:

fffaed173e

Reviewed By: yns88

fbshipit-source-id: 78f3d28c6ce690aec5bf5fc9c2ae50f9684eed12
2020-04-03 21:19:47 -07:00
Adam Simpkins
76577bfafb add is_process_alive() and is_edenfs_process() methods to ProcUtils
Summary:
Add methods to check if a process ID is alive, and if it looks like an EdenFS
process.

This also adds an initial version of ProcUtils for Windows, and implements
these two methods on Windows.  I have moved parts of the `winproc.py` module
to the new `proc_utils_win.py` module, to help better manage dependencies
between our modules.  This keeps all of the Windows-specific `ctypes` code
together in `proc_utils_win.py`.  The functionality that is still left on
`winproc.py` depends on `config.py`, and the `proc_utils` code should not
depend on `config.py` to help avoid circular dependencies.

Reviewed By: wez

Differential Revision: D20833245

fbshipit-source-id: 43e9b6dd1b520dcb6b2da7701de885058f0f7ea2
2020-04-03 20:05:35 -07:00
Lee Howes
dead099771 Rename collectXSemiFuture to collectX
Summary:
Migration from Future-returning executor-erasing collectX forms to
SemiFuture-returning forms, that are less risky in particular with coroutines.

Earlier changes added collectXSemiFuture and collectXUnsafe as a migration
path. We then migrated collectX callsites to collectXSemiFuture or
collectXUnsafe and switched the implementation of collectX to the SemiFuture
form.

This diff renames uses of collectXSemiFuture to collectX, as the two are
identical.

Reviewed By: simpkins

Differential Revision: D20833464

fbshipit-source-id: c14aa40f8cce121632ff922300ef271721c1d695
2020-04-03 17:15:08 -07:00
svcscm
f430f00d07 Updating submodules
Summary:
GitHub commits:

f3ba8f482d
841990708a
e6f3f9ee10
5b16415936
8b5d8c5172
00f8016b36
1f07ffd6c8
830eb1f102
439bb0b090
23441e925a

Reviewed By: yns88

fbshipit-source-id: c94e4ce816bb3f009af307f5a876ae8b03b022c5
2020-04-03 17:00:37 -07:00
Adam Simpkins
dbbb0d64c8 rename the ProcessFinder class to ProcUtils
Summary:
This renames the `ProcessFinder` class to `ProcUtils`, in preparation for
adding some more generic process management utilities into this class.

This class was originally just used for finding stale processes in
`edenfsctl doctor`.  However, it seems like a good place to consolidate all
platform-specific process querying logic.  We are currently need
platform-specific querying to tell if specific process IDs are still running
for `edenfsctl status` and `edenfsctl stop`, and we also already have some
Windows-specific spawning logic in `edenfsctl start`.  I plan to move all of
that logic into this `proc_utils.py` module.

This renames `ProcessFinder` to `ProcUtils` just to better reflect its
expanded purpose.

Reviewed By: genevievehelsel

Differential Revision: D20833243

fbshipit-source-id: 8d33460b7468d877bc327e855af5c620ac5b80a7
2020-04-03 16:52:33 -07:00
Adam Simpkins
17a3c9124d update Python platform checks to use sys.platform
Summary:
Update out platform checks to use `sys.platform` instead of `os.name`

Python type checkers (mypy and Pyre) currently understand checks against
`sys.platform`, and know that code guarded by these checks is platform
specific.  They don't understand the `os.name` checks.

This code should behave the same, but allows type checkers to do a better job
checking this code.

Note that there is also `platform.system()`, but this has drawbacks that it
apparently does runtime-checks to determine the platform, whereas `sys.platform`
is baked-in at compile time.  Additionally, the typecheckers do not appear to
support checking based on `platform.system()` for now.  There is an open
feature request for this for mypy, but it is not implemented yet.

One caveat for `sys.platform` is that the results on Linux are not consistent
across Python versions: older versions of Python used to report `linux2` while
new versions report simply `linux`.

Reviewed By: chadaustin

Differential Revision: D20830149

fbshipit-source-id: d173e41f1ae84951a84b87e2dc05787fe8b01407
2020-04-03 16:52:32 -07:00
Adam Simpkins
83f036f483 update the CLI to find the correct edenfs binary on Windows
Summary:
Update the `edenfsctl.exe` binary to find `edenfs.exe` relative to itself.
This ensures that when you run `edenfsctl.exe` from a development build that it
finds the associated development build of `edenfs.exe`, rather than the current
system-installed version.

Reviewed By: wez

Differential Revision: D20821419

fbshipit-source-id: 29ff0b587800f1b76c0b729512bc19f5aef648a7
2020-04-03 16:52:32 -07:00
svcscm
7c8ca31944 Updating submodules
Summary:
GitHub commits:

a508484ac4
2567ef0027
ecfa0b8720
56ce4f4431
c956c460b0
957bee824b
141a3be453
e60ea7fe57
31e3cc815f
5749f8cc84
6cf0245726
3c29e19b0b
63ddcae81a

Reviewed By: yns88

fbshipit-source-id: ab818598bc00a41506ba2f1bd6940c258ec9aaa6
2020-04-03 15:50:50 -07:00
Xavier Deguillard
7bcf163d55 color: remove all the win32 terminal handling
Summary:
Let's mandate a 256 color terminal in Windows. We also update less to default
to using VT mode: https://github.com/gwsw/less/pull/29

With this, the colors appears to be working as expected on Windows!

Reviewed By: quark-zju

Differential Revision: D20826922

fbshipit-source-id: 5d2a149e2698b3ccc7bf6388b5cd97da20898eb7
2020-04-03 13:47:32 -07:00
Xavier Deguillard
08984182b9 setup: write the pyc before the py during packaging
Summary:
I'm not exactly sure why, but my guess is that by writing the py files first,
the pyc might be copied and not generated, causing Python to not read the pyc
at import time, leading to slow startup time.

Reviewed By: quark-zju

Differential Revision: D20829130

fbshipit-source-id: e838ff18b9fbf65d1a9437e0a8ef58d57803d2fa
2020-04-03 11:35:29 -07:00
Adam Simpkins
0f30169022 codemod collectAll() to collectAllUnsafe() to fix the build on Windows
Summary:
Fix some call sites to use collectAllUnsafe().
It looks like these were missed in D20331206.

Reviewed By: genevievehelsel

Differential Revision: D20833198

fbshipit-source-id: 511f6115a5bfeb5b82f9416d5d54bef25a7209a0
2020-04-03 11:01:55 -07:00
Stanislau Hlebik
bd9fe4db1d mononoke: add missing telemetry to phases
Reviewed By: krallin

Differential Revision: D20839750

fbshipit-source-id: ea1f329cb0cc015461146428601a22685293bfc4
2020-04-03 10:38:42 -07:00
Stanislau Hlebik
0100cd75ee mononoke: asyncify all phases except for trait
Reviewed By: krallin

Differential Revision: D20839242

fbshipit-source-id: 75c5a8f9967c2c71b7e36b74abe151df142fcbab
2020-04-03 10:38:42 -07:00
Stanislau Hlebik
7b26350b74 mononoke: asyncify get_public_derive
Reviewed By: krallin

Differential Revision: D20838069

fbshipit-source-id: 3cda39571fd191f40663da3f1dd51bc03d86e250
2020-04-03 10:38:41 -07:00
Stanislau Hlebik
9ed388e34c mononoke: move phases store to new futures
Reviewed By: krallin

Differential Revision: D20837913

fbshipit-source-id: ddcbce9518255d9dda2cf09b61fdd4939cef5258
2020-04-03 10:38:41 -07:00
Stanislau Hlebik
5bc98d60db mononoke: asyncify test
Reviewed By: farnz

Differential Revision: D20837893

fbshipit-source-id: 43ca705ce2ada1532330da89d69392c6b97b5129
2020-04-03 09:12:18 -07:00
Kostia Balytskyi
717d82a828 unbundle processing: add stats reporting
Summary:
Combined with the unbundle resolver stats, we will be able to say which
percentage of pushrebases fails, for example.

Reviewed By: StanislavGlebik

Differential Revision: D20818224

fbshipit-source-id: 70888b1cb90ffae8b11984bb024ec1db0e0542f7
2020-04-03 09:05:59 -07:00
Kostia Balytskyi
cfadb57637 resolver.rs: report which kind of unbundle was resolved if any
Summary:
We need this to be able to monitor how frequently we get pushes vs
infinitepushes, etc. A furhter diff will add a similar reporting to
`processing.rs`, so that we can compute a percentage of successful pushes to
all pushes, for example.

Reviewed By: StanislavGlebik

Differential Revision: D20818225

fbshipit-source-id: 7945dc285560d1357bdc6aef8e5fe50b61622254
2020-04-03 09:05:58 -07:00
Xavier Deguillard
01e921aa19 crecord: fix windows arrow keys
Summary:
For whatever reason, ncurses doesn't interpret the arrow keys properly... Use
whatever is returned from it instead.

Reviewed By: kulshrax

Differential Revision: D20821432

fbshipit-source-id: 019426a1333538a479fb3dd8d147fb9cb4ba6559
2020-04-03 08:26:26 -07:00
Stanislau Hlebik
a47bb8c5e1 mononoke: use caching in phases more efficiently
Summary:
Our phases caching wasn't great. If you tried to ask for a draft commit then
we'd call mark_reachable_as_public method, bu this method was bypassing
caches.

The reason why we had this problem was because we had caching on a higher level
than necessary - we had SqlPhases struct which was "smarter" (i.e. it has a
logic of traversing ancestors of public heads and marking these ancestors and
public) and SqlPhasesStore which just did sql access. Previously we had our
caching layer on top of SqlPhases, meaning that when SqlPhases calls
`mark_reachable_as_public` it can't use caches anymore.

This diff fixes it by moving caching one layer lower - now we have a cache
right on top of SqlPhasesStore. Because of this change we no longer need
CachingPhases, and they were removed. Also `ephemeral_derive` logic was
simplified a bit

Reviewed By: krallin

Differential Revision: D20834740

fbshipit-source-id: 908b7e17d6588ce85771dedf51fcddcd2fabf00e
2020-04-03 08:23:38 -07:00
Stanislau Hlebik
016f24b93e mononoke: asyncify mark_reachable_as_public
Reviewed By: krallin

Differential Revision: D20836348

fbshipit-source-id: 1f30e69f9b3f47967a54ab0bf70c6f40944098b1
2020-04-03 08:23:38 -07:00
Stanislau Hlebik
74c7d0b11f mononoke: use MemcacheHandler
Summary:
Very small refactoring to store MemcacheHandler (i.e. an enum which can either
be a real Memcache client or a mock) instead of a memcache client.
It will be used in the next diff to create mock caches

Reviewed By: krallin

Differential Revision: D20834916

fbshipit-source-id: cb1e3e8f0ae0e2c0f7018d3a003ada56725c65c6
2020-04-03 04:20:53 -07:00
Stanislau Hlebik
8afcb5aaa3 mononoke: remove SelectPhase method
Summary: SelectPhases does the same thing - no need to keep two queries

Reviewed By: krallin

Differential Revision: D20817379

fbshipit-source-id: 8cc56ea4a94e81f110a286899a8f5c596566a142
2020-04-03 04:20:53 -07:00
Stanislau Hlebik
8ff854c2dc mononoke: move SqlPhasesStore to a separate file
Summary: I'm going to refactor it soon, for now just move it to another file.

Reviewed By: krallin

Differential Revision: D20817293

fbshipit-source-id: 6fb44b4be858ebbd0e8c9dfee160b91806f78285
2020-04-03 04:20:53 -07:00
Jun Wu
4ae44e316a remotenames: move repo._accessedbookmarks to core repo._remotenames._accessedbookmarks
Summary:
Move the attribute so it won't cause an AttributeError when remotenames is not
enabled.

As we're here, also move it to repo._remotenames from repo. This makes the repo
object a bit clearner and avoids loading the accessed bookmarks if remotenames
are not accessed at all.

Reviewed By: singhsrb

Differential Revision: D20821070

fbshipit-source-id: b5a01016451ee202f778cadb2dd418400406fa6b
2020-04-02 19:25:33 -07:00
David Tolnay
1a86366f0e third-party/rust: Turn off async-trait/support_old_nightly
Summary:
This diff turns off the support_old_nightly feature of async-trait (https://github.com/dtolnay/async-trait/blob/0.1.24/Cargo.toml#L28-L32) everywhere in fbcode. I am getting ready to remove the feature upstream. It was an alternative implementation of async-trait that produces worse error messages but supports some older toolchains dating back to before stabilization of async/await that the default implementation does not support.

This diff includes updating async-trait from 0.1.24 to 0.1.29 to pull in fixes for some patterns that used to work in the support_old_nightly implementation but not the default implementation.

Differential Revision: D20805832

fbshipit-source-id: cd34ce55b419b5408f4f7efb4377c777209e4a6d
2020-04-02 17:01:24 -07:00
Thomas Orozco
56251513bf git-sl: remove Mercurial import
Summary:
This isn't actually a Mercurial extension, so we can't be importing Mercurial
imports here. I'm not sure this is actually being used because we apparently
have 2 copies of this (see D20793452, which is also how I came upon this), but
it's probably worth not breaking it.

Reviewed By: farnz

Differential Revision: D20794695

fbshipit-source-id: daaf0f5822567b55a787669073421fd1ce604e08
2020-04-02 12:32:34 -07:00
Durham Goode
9976df9010 watchman: keep using watchman even if there are state-enter/leave errors
Summary:
We've seen a number of recent cases where hg stops using watchman for
status because state-enter or state-leave fail because multiple enters or leaves
are called out of order. The root cause needs to be found, but in the mean time
we should not allow such errors to block of from using watchman entirely.

Let's eat these gracefully and just log that the issue happened.

Reviewed By: quark-zju

Differential Revision: D20807004

fbshipit-source-id: 517d9562febc226ce7db836435ca2ca9db1c68fb
2020-04-02 11:42:59 -07:00
svcscm
5b84cc1f3a Updating submodules
Summary:
GitHub commits:

5f79659f25

Reviewed By: yns88

fbshipit-source-id: 6a19666175fdc2719090869fa57499123ae392d9
2020-04-02 11:40:32 -07:00
Xavier Deguillard
a7e5557baa test: properly set ui.ssh
Summary:
On Windows, we have to do a bit of dance for Windows to stop complaining
about ui.ssh.

Reviewed By: DurhamG

Differential Revision: D20817712

fbshipit-source-id: acbda636fe114fd616dee89b2c4d1c9ff26470bf
2020-04-02 11:26:54 -07:00
svcscm
f503bd3806 Updating submodules
Summary:
GitHub commits:

a5909bd18f

Reviewed By: yns88

fbshipit-source-id: 4edf12e30a36118b5bf0cf21b70d30e6c722abfb
2020-04-02 10:47:41 -07:00
Xavier Deguillard
e7c31f21a4 remotefilelog: set umask when creating the rust stores
Summary:
On shared devservers, all users in svnusers should be able to read/write onto
the stores, set the umask to properly reflect this.

Reviewed By: ikostia

Differential Revision: D20817266

fbshipit-source-id: 8a865f499a35313afd3cbeb5f989175862a3549f
2020-04-02 10:42:40 -07:00