Commit Graph

58503 Commits

Author SHA1 Message Date
Zeyi (Rice) Fan
4e7af724fb avoid using Path.resolve on Windows
Summary:
On Windows, `pathlib.Path.resolve` has an use of uninitialized memory bug in Python 3.6.2. Lego Windows has this version of Python 3 installed.

When `eden prefetch` runs, it will first attempt to read the config file at the root of the repository (`$REPOROOT/.eden/config`). Because of this bug, when we normalize the path in edenfsctl, it will get some random bytes as a result. This subsequently causes `toml.read` to fail as it is unable to read a path containing NUL byte.

As you can see, this is the same exception as we see on Windows:

```
In [1]: open("test\x00")
---------------------------------------------------------------------------
ValueError                                Traceback (most recent call last)
<ipython-input-1-57764b20d660> in <module>
----> 1 open("test\x00")

ValueError: embedded null byte
```

Reviewed By: xavierd

Differential Revision: D22177997

fbshipit-source-id: ab2565c8946d809bc15bc1597b749fb5e9440ca0
2020-06-23 16:55:13 -07:00
Durham Goode
60dfefda40 configs: remove assert for duplicate dynamic config entries
Summary:
The dynamicconfig logic had an assert checking that a config was not
added by the dynamicconfig twice. This isn't actually a valid assert since the
caller could load the config as many times as it wanted.

This happened in hg doctor, where it loaded the ui once manually (without a repo
object) then it loaded it again during the creation of the repo object. I went
ahead and cleaned up hg doctor to not do this, but let's get rid of the assert
anyway.

Reviewed By: quark-zju

Differential Revision: D22194273

fbshipit-source-id: 9491d35fe14523ad3d9cb69b4ca0d615149dd0f0
2020-06-23 16:05:16 -07:00
Durham Goode
7194d19edc sigtrace: fix repo_setup for peer repos
Summary:
D22009699 recently introduced some logic that access repo.localvfs
during repo setup. This doesn't exist for peer repos, so let's exist early if
this is a peer.

Reviewed By: xavierd

Differential Revision: D22197586

fbshipit-source-id: 8f717aa21a0b45f8f85a1ff800ee4a1f86b94bdf
2020-06-23 16:00:59 -07:00
svcscm
0c9fb28585 Updating submodules
Summary:
GitHub commits:

57e825064b
56e5245f4f

Reviewed By: 2d2d2d2d2d

fbshipit-source-id: d6ce61ecdcb35de818a41a666405d613a097d1fd
2020-06-23 16:00:59 -07:00
svcscm
030eb4fc6d Updating submodules
Summary:
GitHub commits:

bb1ef7f6f8
1e2463c72d
f7df7b7dc5
40618dd790
9f21d08660
e0806715d2
ba5f7db858
5c19755353

Reviewed By: 2d2d2d2d2d

fbshipit-source-id: 15e9d69956adaaa554677f20ca28ddfa6068dca6
2020-06-23 14:47:06 -07:00
Jun Wu
5a27825fc0 hgsql: be compatible with older mysql-connector
Summary: This makes it easier to run tests with non-buck build.

Reviewed By: sfilipco

Differential Revision: D22174992

fbshipit-source-id: 11100d608cb78973ae7a63056667f0be4a86ae00
2020-06-23 14:31:17 -07:00
Jun Wu
727c698ce0 rage: include sigtrace for checking hanging processes
Summary: This might make it easier for us to see what processes are hanging.

Reviewed By: sfilipco

Differential Revision: D22009696

fbshipit-source-id: a1c1f97976084160a1b4e4a3ff7d2f9781240f6f
2020-06-23 14:11:49 -07:00
Jun Wu
5d5fca5d6c sigtrace: support collecting sigtrace periodically automatically
Summary:
There are lots of "hanging" questions in the support group. While not all of
them are our fault (ex. mergedriver), we don't have an easy reply to tell
users what's actually going on.

This diff adds a way to write sigtrace periodically so we can include it in
rage output.

Reviewed By: sfilipco

Differential Revision: D22009699

fbshipit-source-id: 5349f613b08507ed02cc0e3fa00963fd7d4c3d21
2020-06-23 14:11:49 -07:00
Jun Wu
5d8ac3af7c ui: provide cmdname
Summary:
A lot of extensions wrap runcommand just to get the command name.
Let's define a proper API for it - ui.cmdname provides the resolved
command name.

Reviewed By: sfilipco

Differential Revision: D22009694

fbshipit-source-id: 4b8744ee5314924ea09c9f325570ce53c849fef5
2020-06-23 14:11:49 -07:00
Jun Wu
6bea32d37c util: move "deleting files older than x" to a utility function
Summary: It will get used later.

Reviewed By: sfilipco

Differential Revision: D22009695

fbshipit-source-id: 6133d9d35992807a6f0a9794b383af020d9d8dd5
2020-06-23 14:11:49 -07:00
Jun Wu
1020f76e7d stackdesc: remove the crate
Summary: The tracing APIs and error context APIs can achieve similar effects.

Reviewed By: xavierd

Differential Revision: D22129585

fbshipit-source-id: 0626e3f4c1a552c69c046ff06ac36f5e98a6c3d8
2020-06-23 14:06:54 -07:00
Jun Wu
98ec775d12 py3: fix treestate related tests
Reviewed By: sfilipco

Differential Revision: D22129405

fbshipit-source-id: 4b3338aa09b0834e3c23d94e50929f9e6105b8f6
2020-06-23 14:06:54 -07:00
Katie Mancini
f8d69a24cf fix rendering of process commands in eden top
Summary:
`eden top` often adds extra quotes to the end of the commands in the process
table, this removes those pesky quotes

Reviewed By: genevievehelsel

Differential Revision: D21440316

fbshipit-source-id: f1200a28a5345691fcce517526d119f44e5993d0
2020-06-23 13:39:45 -07:00
svcscm
caa63d6181 Updating submodules
Summary:
GitHub commits:

1688ef8849
42d5bf14cd
0826fae9e3
a33dae266f

Reviewed By: 2d2d2d2d2d

fbshipit-source-id: 9b5618c8062dd90b004a0d197c6f12bce2f7d308
2020-06-23 13:37:18 -07:00
Carolyn Busch
17dbece6ab tests: fix test-commit-interactive.t for py3
Summary: Make test-test-commit-interactive.t python 3 compatible. Note I wasn't sure if it was worthwhile to spend too much time on the translation portion of the test. If someone objects to the deletion, I can spend more time on it.

Reviewed By: DurhamG

Differential Revision: D22122960

fbshipit-source-id: d232971581fca0532ed05c8ca1fdb7b5e8bd99e0
2020-06-23 12:53:28 -07:00
Carolyn Busch
52d2b59ef5 tests: fix test-shelve-t.py in python3
Summary: Make shelve python 3 compatible.

Reviewed By: DurhamG

Differential Revision: D22122890

fbshipit-source-id: e96d7dc9192f48ad9ec4d33ef8107e99b99e3a61
2020-06-23 12:53:28 -07:00
svcscm
b832b4759d Updating submodules
Summary:
GitHub commits:

c60dab7668

Reviewed By: 2d2d2d2d2d

fbshipit-source-id: 81cc4a392c2d13355ed331a8b1f1c5de2fd0245e
2020-06-23 12:18:58 -07:00
Katie Mancini
1876c4e77b adding logging for selective paths
Summary:
Eden can sometimes unexpectedly fetch files from the server, and we want
to know why this is happening. This adds logging for the source of
data fetching in edens backing store to help obviate why these fetches
are happening.

This temporarily adds the logging in the HgQueuedBacking store to get a naive
version of logging rolled out sooner. Follow up changes will move this logging
closer to the data fetching itself if possible (in HgDatapackStore and HgImporter).

Reviewed By: chadaustin

Differential Revision: D22012572

fbshipit-source-id: b1b012ce4ee133fbacecd586b7365c3c5a5386df
2020-06-23 10:02:41 -07:00
Katie Mancini
8d32611a23 add data fetch logger
Summary:
We have seen that eden will unexpectedly fetch data, we want to know why.

This adds the plumbing to interact with edens current logging to be able to
log when eden fetches data from the server and what caused eden to do this
fetch. Later changes will use the classes created here to log the cause of data
fetches.

Reviewed By: chadaustin

Differential Revision: D22051013

fbshipit-source-id: 27d377d7057e66f3e7a304cd7004f8aa44f8ba62
2020-06-23 10:02:41 -07:00
Katie Mancini
fdb1af8bc9 add cause info to objectFetchContext
Summary:
Recently the server team added an un-used directory to test that eden would not
fetch these as a test for the upcoming repo merge. They saw that these files
were fetched a non trivial number of times. We want to know why eden is causing
these fetches.

This adds the pid and interface through which the client is interacting with eden to
ObjectFetchContext for this purpose. This information will be logged in later
changes.

note: currently this is only for fetches through Fuse (thrift interface to follow).

Reviewed By: chadaustin

Differential Revision: D22050919

fbshipit-source-id: 49b93257a0e6d910f48b1e8ec6471527e056d22a
2020-06-23 10:02:40 -07:00
Katie Mancini
a0b05b4bf0 thread ObjectFetchContext to backing store
Summary:
This passes ObjectFetchContext into the backing store to prepare for adding
logging for the cause of server fetches.

In following changes I will add logging in the HgQueuedBackingStore.
Ultimately we will want to move this logging to be closer to the data fetching
(in HgDatapackStore and HgImporter), but I plan to temporarily add logging to
the HgQueuedBackingStore to simplify so that we can more quickly roll out.

Reviewed By: chadaustin

Differential Revision: D22022992

fbshipit-source-id: ccb428458cbf7a1e33aaf9be9d0d766c45acedb3
2020-06-23 10:02:40 -07:00
Katie Mancini
480277e328 refactor - move ObjectFetchContext to its own file
Summary:
In following changes I will be threading ObjectFetchContext into the backing
store importing process, since this will start to be used more outside of the
ObjectStore, I am moving this class into its own files.

Reviewed By: chadaustin

Differential Revision: D22022488

fbshipit-source-id: 1a291fea6e0fd56855936962363dfc9f6de8533d
2020-06-23 10:02:40 -07:00
Thomas Orozco
edf93f8676 mononoke/blobstore_healer: limit concurrency of healing
Summary: Let's not heal 10000 blobs in parallel, that's a little too much data.

Reviewed By: farnz

Differential Revision: D22186543

fbshipit-source-id: 939fb5bc83b283090e979ac5fe3efc96191826d3
2020-06-23 09:00:29 -07:00
Thomas Orozco
e288354caf sparse: prefetch trees before iterating through the whole manifest
Summary:
If we're going to iterate through the whole manifest, we should probably
prefetch it. Otherwise, we might end up doing a whole lot of sequential
fetching. We saw this this week when a change landed in sparse profiles that
caused requests to Mononoke to increase 100-fold.

Unfortunately, I don't think we can selectively only fetch the things we are
missing, so this just goes ahead and fetches everything unconditionally. If
there is a better way to do this, I'm all ears.

Reviewed By: StanislavGlebik, xavierd

Differential Revision: D22118926

fbshipit-source-id: f809fa48a7ff7b449866b42b247bf1da30097caa
2020-06-23 08:37:23 -07:00
Thomas Orozco
be0d091f91 sparse: add a perf trace scope for sparse profile update additional actions
Summary: This makes it easier to understand why we're fetching so much data.

Reviewed By: quark-zju

Differential Revision: D22114905

fbshipit-source-id: 7cb6d5c9aebcc8c9089891e030b02176e208bd0f
2020-06-23 08:37:23 -07:00
Thomas Orozco
c0de16606e mononoke: fix broken blobrepo override refactor
Summary: This got broken in D22115015 — this fixes it.

Reviewed By: farnz

Differential Revision: D22186138

fbshipit-source-id: 54c05466cdbd3be4f6887a852f099351ea5e891e
2020-06-23 08:10:13 -07:00
Viet Hung Nguyen
2cf5388835 mononoke/git: moved fn gitimport to import_tools
Summary: Moved fn gitimport + do_upload and find_file_changes functions (fn gitimport uses them) to import_tools (previous refactor commits: D22135765, D22139276).

Reviewed By: StanislavGlebik

Differential Revision: D22159880

fbshipit-source-id: ba97a77fdada97ad8c348e16e5edcd7ad58662af
2020-06-23 05:16:01 -07:00
svcscm
b47ba5bbc6 Updating submodules
Summary:
GitHub commits:

d22c5b7f65

Reviewed By: 2d2d2d2d2d

fbshipit-source-id: bd239eb768785f05d0f431117232e2edd3ce3a1e
2020-06-23 04:39:51 -07:00
Kostia Balytskyi
6b370f24e3 tests: add configerator commitsync fixtures
Summary: This will be used in the following diffs. It just adds commitsync fixtures in a single place, so that we can later play with them in integration tests.

Reviewed By: StanislavGlebik

Differential Revision: D21952665

fbshipit-source-id: 2933a9f7ea8343d5d52e6c3207e7d78a3ef0be25
2020-06-23 04:33:17 -07:00
svcscm
d694998dec Updating submodules
Summary:
GitHub commits:

c289b7f569

Reviewed By: 2d2d2d2d2d

fbshipit-source-id: 698d566320f036801b15d9071a2223995111d214
2020-06-23 01:35:03 -07:00
svcscm
1d2a20343f Updating submodules
Summary:
GitHub commits:

b1b2993aad
80f7058b61
f6308a459e
8f0b3ec6ff
c4241df843
1b7ee174d3
08f357d6c8
f63ea92e5d
bb7ef2bec0
84a0e8ee63
4eb8d32ed6

Reviewed By: 2d2d2d2d2d

fbshipit-source-id: 9854d78015c5938a4bceb40c36b691edd2344176
2020-06-23 01:35:03 -07:00
svcscm
e3296a6c78 Updating submodules
Summary:
GitHub commits:

9322e70f43
5b32e69a10
183e82f46a
59ce0d0d26
7b51c12b9f
e8931303cc
b7c87f5988
87dc0ea65c
58156db1cd
d803368008
a17109fa9d
5e55e7fad0

Reviewed By: 2d2d2d2d2d

fbshipit-source-id: d142c88c16ae30b994b101b6455d11f7e1a1e977
2020-06-22 20:20:20 -07:00
Shrikrishna Khare
58eac05c56 fbcode_builder: getdeps: OpenNSA update source URL
Summary:
We had to fork OpenNSA and clone from it, see D19437386 for details.
Broadcom has now started hosting OpenNSA as a tarball.
Thus, we no longer need to maintain a fork (yay!)

This patch points opennsa manifest to fetch opennsa from this new location.

Reviewed By: bkoray

Differential Revision: D22175932

fbshipit-source-id: 51cd777ab836e4f191d78fbb2312925e446ca38f
2020-06-22 19:39:11 -07:00
Zeyi (Rice) Fan
8cc4c2f5c5 fix encoding bug
Summary: This bug can be triggered when your computer name contains emoji. getdeps.py will fail to create this file due to Python attempts to write the file as cp1252 (Windows's default encoding)

Reviewed By: wez

Differential Revision: D22171935

fbshipit-source-id: fc3be2d1050c17ddbe05a0fc91d6613865f092ce
2020-06-22 19:05:28 -07:00
Durham Goode
f9c03960e2 py3: set LC_ALL for a rm line in test-fb-hgext-pushrebase-cannot-rebasepublic.t
Summary:
This test appears to fail when run in hgbuild. It's not clear why it
doesn't repro locally, but it appears to be a locale issue, so let's just for it
to use C.

Reviewed By: singhsrb

Differential Revision: D22178365

fbshipit-source-id: 007c86681ff1bd4845b1feb41b7bbb031edf172b
2020-06-22 19:01:02 -07:00
svcscm
555ec831e4 Updating submodules
Summary:
GitHub commits:

f74b4d5fe4
ef34a4cf89
8805ec2792

Reviewed By: 2d2d2d2d2d

fbshipit-source-id: 7b26d2f0b17134c8401e1fcf9bd8b0ad1871fb49
2020-06-22 18:38:38 -07:00
Jun Wu
24cec5f002 phrevset: be robust about unexpected server responses
Summary:
The server response is not strictly typed. Accessing fields might error out.
Protect against those errors.

Reviewed By: chadaustin

Differential Revision: D22169401

fbshipit-source-id: 4e57220d03c322b5b40d81ac63f4391e286525e4
2020-06-22 17:14:03 -07:00
Jun Wu
eee323b08b util: optimize truncatefile
Summary:
On platform the code is expected to run (Windows), the performance difference
is significant (ex. 1.3s -> 0.8s).

The following benchmark emulates truncating the last 4 revisions from changelog:

```
# hg debugshell on Windows
In [2]: clsize = repo.svfs.stat("00changelog.i").st_size

In [3]: def f1():
   ...:     util.tryunlink(repo.svfs.join("new"))
   ...:     shutil.copyfile(repo.svfs.join("00changelog.i"), repo.svfs.join("new"))
   ...:     with repo.svfs.open("new","a") as f:
   ...:         f.truncate(clsize - 256)

In [5]: def g1():
   ...:     util.tryunlink(repo.svfs.join("new"))
   ...:     with repo.svfs.open("00changelog.i") as f1, repo.svfs.open("new", "w") as f2:
   ...:         size = clsize - 256
   ...:         while size > 0:
   ...:             bufsize = min(size, 1 << 24)
   ...:             f2.write(f1.read(bufsize))
   ...:             size -= bufsize

In [6]: %timeit f1()
1 loop, best of 3: 1.13 s per loop

In [7]: %timeit g1()
1 loop, best of 3: 716 ms per loop

In [8]: %timeit f1()
1 loop, best of 3: 1.51 s per loop

In [9]: %timeit g1()
1 loop, best of 3: 853 ms per loop

In [30]: %timeit f1()
1 loop, best of 3: 1.28 s per loop

In [31]: %timeit g1()
1 loop, best of 3: 755 ms per loop
```

I also removed the `vfs.exists` test as the function should raise if the file
does not exist.

Reviewed By: DurhamG

Differential Revision: D21974771

fbshipit-source-id: 358579c057eb694ce6e5b135cf95067dbc66f6f3
2020-06-22 17:11:11 -07:00
Arun Kulshreshtha
c1d964b17e tests: make EdenAPI server available to tests
Summary: Add the EdenAPI server to the `hg_mononoke_run_tests` test target. This will make it possible to start an EdenAPI server in Mercurial's Buck tests.

Reviewed By: quark-zju

Differential Revision: D22147098

fbshipit-source-id: 1e29b7c06f1dd74f26d821943cd44ef09a7d505f
2020-06-22 15:18:20 -07:00
svcscm
95778da581 Updating submodules
Summary:
GitHub commits:

5b2bbacb6f
2cefaba10e

Reviewed By: 2d2d2d2d2d

fbshipit-source-id: 4ef584697f1c9da53c2ab7a6511f9b009f43cf16
2020-06-22 14:46:21 -07:00
Pavel Aslanov
d91ca5004f remove HgPhase type
Summary: `HgPhase` type is redundant and was adding dependency on mercurial in phases crate.

Reviewed By: farnz

Differential Revision: D22162716

fbshipit-source-id: 1c21841d34897d0072ff6fe5e4ac89adddeb3c68
2020-06-22 13:51:33 -07:00
Durham Goode
a0f1169789 py3: fix test-fb-hgext-sampling.t
Summary: Now it passes

Reviewed By: quark-zju

Differential Revision: D22143037

fbshipit-source-id: 725269096d7f29872d945b9cbfceedfcfad4e459
2020-06-22 11:34:03 -07:00
Durham Goode
474877a124 py3: fix test-hook.t
Summary: It now passes

Reviewed By: quark-zju

Differential Revision: D22145284

fbshipit-source-id: 235a0d4b75bd1bae402e61cf36f978a515190a8f
2020-06-22 11:29:42 -07:00
Durham Goode
d9be71caf7 py3: fix test-bookmarkstore.py
Summary: Easy fix

Reviewed By: quark-zju

Differential Revision: D22143857

fbshipit-source-id: c35e7121a2be4152da24d19615dc38d551011282
2020-06-22 11:29:41 -07:00
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
svcscm
79672cf550 Updating submodules
Summary:
GitHub commits:

019c76a042
b9d387fc4f
c73a7e5439
7b0535c525
c06e288b52
c5957aaf11
89689ef8cf
6a5fdd1085
5ba53844dd
70f40cc1c2
d04e487182

Reviewed By: 2d2d2d2d2d

fbshipit-source-id: f68f464e1ae6ba2e8a74b71b3675b0c8feec986b
2020-06-22 09:40:27 -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
svcscm
d822685229 Updating submodules
Summary:
GitHub commits:

7f836bd96a
d8e75ec617
e4f13fcbfe
19c88ba5b6
4e6697fcb7
0c7db3e979
9a06a7e3aa
ad21747d1e
7a89fe5dcd
ba45108be6
b3b65054b3
6d24bb0b6a
9975095ca0

Reviewed By: zpao

fbshipit-source-id: 218d4590e76bf67941d551add7ea1b5541137998
2020-06-22 09:02:32 -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