Commit Graph

5723 Commits

Author SHA1 Message Date
Durham Goode
96e6337e2a py3: fixes test-export-t.py
Summary: It now passes

Reviewed By: quark-zju

Differential Revision: D22146555

fbshipit-source-id: 97b82a9dcd564a287e590940f6191456ca059868
2020-06-22 11:27:52 -07:00
Chad Austin
65e7a01d6f allow async subcmd run functions
Summary: In advance of peppering async everywhere, allow subcmd's run method to be async.

Reviewed By: genevievehelsel

Differential Revision: D21892187

fbshipit-source-id: f611faacf95649d8bb5588aeefc4546bd5f63984
2020-06-22 11:27:11 -07:00
Stanislau Hlebik
8ff0c411cc mononoke: yield if we do a lot of skips in skiplist
Summary:
During expensive getbundle request traversing skiplist uses a lot of cpu, and
in fact it's blocking the whole CPU. krallin suggested to yield since it
should avoid blocking cpus, and that's what this diff is doing.

Reviewed By: krallin

Differential Revision: D22160477

fbshipit-source-id: 5bd881d5c50f4d8e64f2cc90389abc8568ec1df6
2020-06-22 09:20:40 -07:00
Carolyn Busch
69e652b380 demanedimportpy3: fix demandimport for ipdb
Summary:
Fix error "AttributeError: module 'concurrent.futures' has no attribute
'_base'" when loading asyncio.base_futures module. There very well may be a more appropriate fix, but this allows ipdb python3 debugging.

Reviewed By: quark-zju

Differential Revision: D22144225

fbshipit-source-id: eb6a96f79c97e3bd40c1efd9fc75660d6fc372ea
2020-06-22 08:59:14 -07:00
Pavel Aslanov
f1749771f7 fix/rearange mononoke.blobrepo stats
Summary: move some stats from BlobRepo to BlobRepoHg

Reviewed By: farnz

Differential Revision: D22117927

fbshipit-source-id: 0f2b10874236798a4af2afb50b50d32cd1cbbcc6
2020-06-22 07:29:20 -07:00
Pavel Aslanov
d13768d768 move DangerousOverride into a separate crate blobrepo_override
Summary: DangerousOverride is moved into a separate crate. Not only it is usually not needed but it was introducing dependencies on mercurial crate.

Reviewed By: StanislavGlebik

Differential Revision: D22115015

fbshipit-source-id: c9646896f906ea54d11aa83a8fbd8490a5b115ea
2020-06-22 07:29:19 -07:00
Pavel Aslanov
704cf3a84c change blobrepo to be a wrapper around inner structure
Summary: This change will ensure that cloning blobrepo is cheap, even if someone adds field that is expensive to clone. Plus it will result in just one arc-clone instead of cloning all the fields one by one.

Reviewed By: mitrandir77

Differential Revision: D22114066

fbshipit-source-id: ca0c3c78033b4c74872da314a32deb37c05b70ca
2020-06-22 07:29:19 -07:00
Pavel Aslanov
371a3a5366 move Globalrev for mercurial_types to mononoke_types
Summary: Globalrev does not have any dependencies on mercurial so it can be moved to mononoke_types since it is used in BlobRepo

Reviewed By: StanislavGlebik

Differential Revision: D22092491

fbshipit-source-id: 1dded88eb2ace08e8c6c3673e2d50ae1fbb9850d
2020-06-22 07:29:19 -07:00
Pavel Aslanov
ea79e79538 move all mercurial content generation logic to blobrepo_hg
Summary: Move all mercurial changeset generation logic to `blobrepo_hg`. This is preliminary step is required to decouples BlobRepo from mercurial, and in later stages it will be moved to derived data infra once blobrepo is free of mercurial.

Reviewed By: StanislavGlebik

Differential Revision: D22089677

fbshipit-source-id: bca28dedda499f80899e729e4142e373d8bec0b8
2020-06-22 07:29:19 -07:00
Pavel Aslanov
6c1e575411 move HgMutationStore to attributes
Summary: move HgMutationStore to attributes, and all related methods to BlobRepoHg

Reviewed By: StanislavGlebik

Differential Revision: D22089657

fbshipit-source-id: 8fe87418ccb8a7ad43828758844bdbd73dc0573d
2020-06-22 07:29:19 -07:00
Pavel Aslanov
905c8b213e move Filenodes to BlobRepo::attributes
Summary: Move `Filenodes` to `BlobRepo::attributes` as it is mercurial specific.

Reviewed By: ikostia

Differential Revision: D21662418

fbshipit-source-id: 87648a3e6fd7382437424df3ee60e1e582b6b958
2020-06-22 07:29:19 -07:00
Pavel Aslanov
a1f5e45a5a BlobRepoHg extension trait.
Summary: This diff introduces `BlobRepoHg` extension trait for `BlobRepo` object. Which contains mercurial specific methods that were previously part of `BlobRepo`. This diff also stars moving some of the methods from BlobRepo to BlobRepoHg.

Reviewed By: ikostia

Differential Revision: D21659867

fbshipit-source-id: 1af992915a776f6f6e49b03e4156151741b2fca2
2020-06-22 07:29:19 -07:00
Pavel Aslanov
2a746920b6 make it possible to store arbitrary type in blobrepo with dependency on it
Summary:
This diff adds additional filed `BlobRepo::attributes`  which can store attributes of arbitrary type. This will help store opaque types inside blobrepo without creating dependency on a crate which contains type definition for this attribute. This diff also moves `BonsaiHgMapping` inside attributes set.
- This work will allow to move mercurial changeset generation logic to derive data infrastructure

Reviewed By: ikostia

Differential Revision: D21640438

fbshipit-source-id: 3abd912e7227738a73ea9b17aabdda72a33059aa
2020-06-22 07:29:19 -07:00
Lukas Piatkowski
6ebd409406 mononoke/integration tests: separate out facebook-specific code for running integration tests
Summary: Not all facebook-specific code was moved out of integration_runner_real.py, but removing part of the code that is left would made the code less readable, the rest of it will be removed while the integration_runner_real.py is made usable for OSS

Reviewed By: farnz

Differential Revision: D22114948

fbshipit-source-id: d9c532a6a9ea653de2b12cffc92fbf45826dad37
2020-06-22 06:36:12 -07:00
Alex Hornby
5e9223f633 mononoke: add link support to CountedBlobstore
Summary: Add link support to CountedBlobstore

Reviewed By: StanislavGlebik

Differential Revision: D22090644

fbshipit-source-id: 36dc5454f1ca12c91d0eac6e5059f554ac5cb352
2020-06-22 03:15:53 -07:00
Alex Hornby
1458abb967 mononoke: fix cacheblob test build
Summary: Fix cacheblob test build

Differential Revision: D22158585

fbshipit-source-id: 2b702203b52e8dbf04c6afce1b8b3795101f5043
2020-06-22 02:31:40 -07:00
Stanislau Hlebik
0b7493f2f4 mononoke: add support for performing a move in a stack of commits
Summary:
Previously perform_move was able to only create a single commit that moves all
files. However this commit can be very large and it can cause problems for
different sync jobs. Let's add a method that all the files in the stack of
commits rather than in a single commit.

Reviewed By: ikostia

Differential Revision: D22067851

fbshipit-source-id: aff4d01cd547eb98dd6f0c45704371724acee9fc
2020-06-22 00:48:09 -07:00
Stanislau Hlebik
dc84f9741d mononoke: try to compress values if they above cachelib limit
Summary: If a value is above cachelib limit let's try to compress it.

Reviewed By: krallin

Differential Revision: D22139644

fbshipit-source-id: 9eb366e8ec94fe66529d27892a988b035989332a
2020-06-20 01:05:54 -07:00
Ailin Zhang
cec1cf648c make ObjectStore manage a PID-fetchCounts map
Summary: This diff adds a PID-fetchCounts map to `ObjectStore` and makes `ObjectStore` update that map after every `didFetch`

Reviewed By: kmancini

Differential Revision: D22100413

fbshipit-source-id: 740342c7b4a453fe482344c2db9542381c3772e4
2020-06-19 21:07:49 -07:00
Xavier Deguillard
afc1a33c21 pyrevisionstore: aggressively release the GIL
Summary:
In the case where an expensive network operation is involved, holding the GIL
would mean that Mercurial cannot display progress bars, or simply cannot be
interrupted. This is a less than ideal user experience.

To fix this, let's release the GIL whenever we enter into the revisionstore
code.

Reviewed By: DurhamG

Differential Revision: D22140399

fbshipit-source-id: 131c8cf81e39128810e0f20d1922b5681a33d95a
2020-06-19 19:54:21 -07:00
Xavier Deguillard
275de2a00e revisionstore: add tracing spans to lfs code
Summary: This will help in debugging potential performance issues.

Reviewed By: DurhamG

Differential Revision: D22140035

fbshipit-source-id: d7403897fbb843a4eca874c1da3788190d181bc0
2020-06-19 19:54:21 -07:00
Xavier Deguillard
b8744c42cc revisionstore: add a timeout when sending lfs requests
Summary:
We've seen a handful of hangs in the LFS code, adding a timeout on the
connection request would help in surfacing issues when the client for some
reason doesn't get a reply from the server.

We unfortunately can't add a general timeout, as a user's connection speed
would need to be taken into account.

Reviewed By: krallin

Differential Revision: D22139560

fbshipit-source-id: 0118fb8a38af488e2f40bed0a09677bc68d666a8
2020-06-19 19:54:21 -07:00
Xavier Deguillard
c87a18ebae revisionstore: enable all tokio's features
Summary:
At least one mac user had a confirmed hang in the new LFS code that caused us
to rollback LFS for fbsource. One of the thing that was weird is that both
Sandcastle and devservers have several orders of magnitude higher request to
the LFS server and thus we would expect this issue to be widespread there. We
haven't seen this.

One of the difference between the package on the devservers/sandcastle and on
macs is how they are compiled. The former is with buck, while the later is with
cargo, and the package built with buck has all the tokio features enabled,
while cargo has no features enabled. What interest us here is the kind of
scheduler that is in use: on mac the basic scheduler, on devserver/sandcastle,
the threaded scheduler.

While I'm not entirely convinced that the difference in the scheduler is what
causes the hang, it's a good idea to make sure that both of our packages are
compiled the same way.

Reviewed By: krallin

Differential Revision: D22138593

fbshipit-source-id: ce9e64a6a930d2b0cccb634a1af9c3b5b8816a21
2020-06-19 19:54:21 -07:00
Xavier Deguillard
2e184e2a1a integration: rename blacklist.py
Summary: The word "disabled" better express the intent behind it.

Reviewed By: fanzeyi

Differential Revision: D21945736

fbshipit-source-id: a61a3df4f1b704224e7f4d4a7f1a43f4d2b5b2aa
2020-06-19 18:13:20 -07:00
Xavier Deguillard
8883532338 tests: enable unlink_test on Windows
Summary:
Removing a directory with unlink raises different errors on Windows: EACCES
instead of EISDIR.

Reviewed By: fanzeyi

Differential Revision: D21944455

fbshipit-source-id: 251ceb305a46c01ece78f45b0fa8000778c6c650
2020-06-19 18:13:20 -07:00
Xavier Deguillard
51df752a46 cli: support re-mounting a repo on Windows
Summary:
On Windows, we can't rely on the .eden directory to not be present to decide if
the repository is mounted. Instead, we can just let edenfs decide and catch the
exception if it tells us that it's already mounted.

Reviewed By: fanzeyi

Differential Revision: D21934538

fbshipit-source-id: 60ed9f530456b627091f95f7387dc4b8f3a8dc5c
2020-06-19 18:13:20 -07:00
Xavier Deguillard
5d96bcae3c tests: enable some integration tests
Summary: These appear to be passing, let's enable them.

Reviewed By: genevievehelsel

Differential Revision: D21820196

fbshipit-source-id: bb36e48d02411b1dc94e3d1e499f892145cee6ae
2020-06-19 18:13:19 -07:00
Xavier Deguillard
7862d8fde0 mount: enable unmount
Summary:
All the unification of the mount code lead to this point, where supporting
unmount is merely just removing the various #ifdef.

Reviewed By: fanzeyi

Differential Revision: D21797078

fbshipit-source-id: 7602eb85e3fa276b72daebda36ae269ec38cde66
2020-06-19 18:13:19 -07:00
Xavier Deguillard
4fcdd44819 prjfschannel: add a stop promise
Summary:
On unmount, the code relies on the channel (fuse/prjfs) to set a promise, while
not strictly required on Windows as the interface is synchronous, this will
enable unmount to be the same between on all platforms.

Reviewed By: fanzeyi

Differential Revision: D21797081

fbshipit-source-id: c3eac448d2b13ef49db7a7d1f36bb084130ea63a
2020-06-19 18:13:19 -07:00
Xavier Deguillard
ffb214384d mount: unify channelMount
Summary:
Most of what fuseMount does can be shared between fuse and prjfs, so let's
rename it and start using it on Windows.

Reviewed By: fanzeyi

Differential Revision: D21797079

fbshipit-source-id: b92a36ecc702ee72df8ebdf9534add42bea9b97e
2020-06-19 18:13:19 -07:00
Xavier Deguillard
b3a13a6fd8 debugedenimporthelper: make it python3 compatible
Summary:
While the code contained type information, some of them were not entirely
correct, path for instance should be str, command arguments are also passed in
as str, not bytes.

Reviewed By: ikostia

Differential Revision: D22104689

fbshipit-source-id: 50cbc9f81a3d9cc324f9105f0bbfbc71d9ca9e98
2020-06-19 16:52:30 -07:00
Jeremy Fitzhardinge
c97d050994 eden: fix up unused Rust dependencies
Reviewed By: StanislavGlebik

Differential Revision: D22132460

fbshipit-source-id: 4a86bdf31254172aa33ff286127429b956e606ec
2020-06-19 16:11:09 -07:00
Arun Kulshreshtha
88ecb984c5 tests: rename environment variables
Summary: Per our ongoing effort to reduce the usage of potentially problematic terminology, rename the environment variables used to include and exclude tests.

Reviewed By: singhsrb

Differential Revision: D22143371

fbshipit-source-id: 97a0f73b21183f94d34af929e75cd531e4e24196
2020-06-19 15:33:18 -07:00
Durham Goode
74da65a38f py3: reupgrade mysql-connector-python to yummy version
Summary:
This is required for migrating to python 3. Originally this broke
builds on non-fbcode centos7 platforms. Since we don't need hgsql in non-fbcode
platforms, I've just tweaked it to skip the hgsql tests for non-fbcode centos7.

Reviewed By: quark-zju

Differential Revision: D22140187

fbshipit-source-id: 01676db9d006375bd3b5ae9e8f13f5592e36b074
2020-06-19 15:25:26 -07:00
Stefan Filip
a2cbbf7f89 python3: fix test-eol.t
Summary: In Python3, b'a\n'[-1] is 10 whereas in Python2 it is "\n".

Reviewed By: quark-zju

Differential Revision: D22128582

fbshipit-source-id: 3b13a14efd81ea2de4fd7125597e3c7ec6371492
2020-06-19 15:22:32 -07:00
Chad Austin
6d79d2559a fall back on the subprocess telemetry logger when necessary
Summary:
When the scuba telemetry logger is unavailable, fall back on the
subprocess.

Reviewed By: genevievehelsel

Differential Revision: D21687855

fbshipit-source-id: c58a4bc1b34974add35d194c8aafdaac7ed47fdb
2020-06-19 15:15:26 -07:00
Stefan Filip
d0987cd948 python3: fix test-atomictestfile.py
Summary: Python3

Reviewed By: xavierd

Differential Revision: D22125298

fbshipit-source-id: 2eb63a697be59bd33c9328fba5ef96a4cae66f43
2020-06-19 15:15:26 -07:00
Stefan Filip
690ccca46d python3: convert test-url to python3
Summary: Python 3

Reviewed By: quark-zju

Differential Revision: D22124540

fbshipit-source-id: 6ede3929bce8aed55c6203e305d08cfb312737e7
2020-06-19 15:11:55 -07:00
Viet Hung Nguyen
615e783be7 mononoke/git: moved remaining gitimport objects to import_tools
Summary: Moved the remaining (e.g. GitPool, GitLeaf...) objects from gitimport to import_tools. (first commit: D22135765 (41dd725914))

Reviewed By: StanislavGlebik

Differential Revision: D22139276

fbshipit-source-id: c79e97e52fe58761d6065f24ab35d3887cb65b0d
2020-06-19 14:17:15 -07:00
Durham Goode
d02d5cdbfe py3: fix test-fsmonitor*
Summary: These now pass

Reviewed By: quark-zju

Differential Revision: D22127383

fbshipit-source-id: bcaad400d9f849251e396b68ad1b4d04c8831314
2020-06-19 13:40:18 -07:00
Durham Goode
2138a84cee py3: fix test-fb-hgext-fastannotate-*
Summary: They now pass

Reviewed By: quark-zju

Differential Revision: D22126938

fbshipit-source-id: 60655e470d56187f50220b56a4628af73833066c
2020-06-19 13:40:18 -07:00
Durham Goode
fe720eb8cf py3: fix test-commit.t
Summary: It had some in-test python that needed to be updated.

Reviewed By: quark-zju

Differential Revision: D22097852

fbshipit-source-id: ebe4ab19a2e4bed73badc1d34d6fcf2db6072559
2020-06-19 13:40:17 -07:00
Durham Goode
4bfa413ecc py3: fix test-fb-hgext-errorredirect.t
Summary: It now passes

Reviewed By: quark-zju

Differential Revision: D22105461

fbshipit-source-id: 0f19faaf7fe3b365e2c825625838a74eea3ee9eb
2020-06-19 13:40:17 -07:00
Durham Goode
45b9cabfb3 py3: fix test-profile.t
Summary: Now it passes

Reviewed By: xavierd

Differential Revision: D22104180

fbshipit-source-id: 7d5f512d4294ced12d60e5ea7b2e9121447247c0
2020-06-19 13:40:17 -07:00
Durham Goode
24e2c44860 py3: fix test-dispatch.t and statprof
Summary: Fixes test-dispatch.t and fixes statprof while we're at it.

Reviewed By: xavierd

Differential Revision: D22103518

fbshipit-source-id: 7d795c6f9e3e2c8958746c10e39f55922a923dc5
2020-06-19 13:40:17 -07:00
Durham Goode
6dd5d70b1e py3: fix test-ssh.t
Summary: It now passes

Reviewed By: xavierd

Differential Revision: D22102239

fbshipit-source-id: 78a680eb06ad1ab1be94279c7c4668be9a8673be
2020-06-19 13:40:17 -07:00
Durham Goode
4409ebb103 py3: fix test-context.py
Summary:
It now works with python 3.  I dropped some test output.  In one case
it was confirming that various path encoding work, but we only support utf8 now.
I also dropped some bit that enabled debug output, since the output order was
not the same between python 2 and 3 and it seemed non-trivial to fix.

Reviewed By: xavierd

Differential Revision: D22101132

fbshipit-source-id: 682e7c61f1dd18cce34bdc014c85d560f883bd18
2020-06-19 13:40:17 -07:00
Durham Goode
7f1588131b py3: set LANG="en_US.UTF-8" for most tests
Summary:
We support unicode file paths, and in python 3 those get passed to
python libraries as unicode strings. The tests set LANG=C which mean the python
library tries to convert the path to ascii, but fails for any non-ascii
characters. Let's switch to LANG="en_US.UTF-8" to match our production
behavior and make tests about unicode paths work.

Reviewed By: xavierd

Differential Revision: D22098359

fbshipit-source-id: c3057edc66e6e32f7b8b49374e622d02bd05711f
2020-06-19 13:40:17 -07:00
Durham Goode
8a15d29e7f py3: fix test-visibility.t
Summary:
This module was using binascii.hex directly instead of using Mercurial hex
function.

Reviewed By: xavierd

Differential Revision: D22096490

fbshipit-source-id: 32c912c16415ffd94371ad945c4df2f5a82b92e5
2020-06-19 13:40:17 -07:00
Meyer Jacobs
49d5ada3f4 status: remove pickle formatter, fix test
Summary:
Remove pickle formatter, as part of python3 migration.

Fix test-status.t for python3 compatibility.

Remove test-status.t python2 requirement.

Reviewed By: xavierd

Differential Revision: D22121912

fbshipit-source-id: 1cfdd18880198ef16973463ed24cf9afb28a7afb
2020-06-19 13:31:25 -07:00