Summary: The admin tool currently doesn't register the `fb303` extension with `MononokeApp` during its creation. This makes the tool incapable of registering for health check and responding to thrift health check requests by TW. In absence of ALIVE response from the job, TW ends up killing it. This diff adds the extension during `MononokeApp` construction. This will not impact admin tool's usage through CLI but the error messages in the integration tests will need to be updated.
Differential Revision: D46147128
fbshipit-source-id: f06b8bcdce938346726b9ff520a3d809d9fda6fc
Summary: Makes it easier to rollback
Reviewed By: mitrandir77
Differential Revision: D46156526
fbshipit-source-id: eae70801069d09ab03b3b683712d9353fb1e5a43
Summary:
EdenFS contains several layers of caching for BlobMetadata:
- In the hgcache,
- In the in-memory BlobMetadata cache,
- In the LocalStore (configurable),
- In the FileInode,
- In the TreeEntry,
All of the above must be filled prior to reading a blob, therefore computing
the sha1+size when reading a blob is likely not needed and superfluous.
Alternatively, we could move the code to be done in the background in the
LocalStoreCachedBackingStore to avoid blocking reading the blob. Reviewers
opinions are welcome!
Reviewed By: chadaustin
Differential Revision: D45625432
fbshipit-source-id: ad7d897c32cbfd590dce5a3a9c8073349e9b70c8
Summary: The bookmark `get` command simply displays the changeset that is pointed to by the bookmark. This diff modifies the command to also handle git annotated tags converted into bookmarks. If the bookmark is a tag bookmark, then the command also outputs the metadata changeset associated with the bookmark. This will be useful for validating that imported annotated tags retain their metadata through metadata changesets.
Differential Revision: D46022692
fbshipit-source-id: b3980f4799066913268ef7acc1f4956d3feb5b23
Summary: `BonsaiTagMapping` exists as a facet so let's add the appropriate builder methods in `RepoFactory` and `TestRepoFactory`. Follow-up diffs will add this new facet in the `Repo` facet container for `SCS` (for `remote-gitimport`) and in `gitimport`.
Differential Revision: D46020528
fbshipit-source-id: 88e65a498355bf21edc8c8d8aa3755a5507fe991
Summary:
The `metadata-diff` endpoint in SCS is used by Phabricator to get information about the difference between files of two commits. Currently, this endpoint works using raw file content. This diff makes the following optimizations:
- Avoids loading file content in memory if the file is `binary` or `non-utf8`
- Avoids parsing `generated` and `partially-generated` tags if the file is known to be neither
- Avoid parsing raw file bytes into UTF-8 string if the file is non-generated
These optimizations will be most helpful for the case of `binary` or `non-utf8` files but should improve performance of the endpoint in general.
Reviewed By: YousefSalama
Differential Revision: D46109336
fbshipit-source-id: b3c915005686f77defceeb53f1587049bc8b6bd8
Summary:
For tools that want to take advantage of the same fast-path logic when
directories don't change across updates, expose a semistable ID they
can use to cache derived data or get a rough understand when a
directory has changed its contents.
Reviewed By: kmancini, xavierd
Differential Revision: D45974142
fbshipit-source-id: 7b2b482876b07e73514a936e198de2dc31ed1597
Summary:
thrift_test is pretty general. For something like getFileAttributes,
getFileAttributesV2, and readdir, it's nice to have them in one file.
Reviewed By: kmancini
Differential Revision: D45974095
fbshipit-source-id: ca5ecd4795f1d278f4de5b83cb8c9af94c111902
Summary: Implement an alternative to slice_repository using the new commit graph that doesn't depend on the skiplist. Useful when doing any kind of processing that requires ancestors to be processed first (backfilling derived data, mirroring commits, ...)
Reviewed By: mitrandir77
Differential Revision: D45607347
fbshipit-source-id: b2012972472e718522e4f33ff01fc9b253b76fff
Summary: Makes slightly more sense
Reviewed By: mitrandir77
Differential Revision: D45607346
fbshipit-source-id: 6b505796da96ff24cd7d555290dcf341f93c797f
Summary: My fingers are tired from scrolling
Reviewed By: mitrandir77
Differential Revision: D45607349
fbshipit-source-id: fe366797a37fbd1682ca917d6bdd39c88195c8e9
Summary: common_base returns all of the highest generation changesets that are common ancestors of two changesets. Implementation is optimized for the most common case were there are no merges between the two changesets and their lowest common ancestor (taking O(log(height) iterations in that case), but is sound for all cases.
Reviewed By: mitrandir77
Differential Revision: D45480232
fbshipit-source-id: 147b6feaa57cdbeb5efb4b77335728f38105fb87
Summary:
The changed something in 0.5 version, and cargo compilation of buck2 broke.
Let's just use latest version.
Reviewed By: zertosh
Differential Revision: D46106140
fbshipit-source-id: 67f4f63eff8e80be8408089003f1171e8b0e1865
Summary:
The bookmark update log is sequential and we can't write two things to it at
once (for a single repo). The aosp megarepo infra sometimes moves two bookmarks
concurrently and hits this ugly race: P743467889. Let's add retries to failed
bookmark moves.
Reviewed By: YousefSalama
Differential Revision: D46105621
fbshipit-source-id: 5c822301fc3201b070c1fe29eda6c395d265c33f
Summary: This diff adds unit tests to validate that the `BonsaiTagMapping` implementation works as expected.
Reviewed By: mitrandir77
Differential Revision: D46020108
fbshipit-source-id: 12e8268363f0917645a5eadd37eff321b510b755
Summary: Constructs a preloaded commit graph when preloaded_commit_graph_blobstore_key is set in repo config.
Reviewed By: RajivTS
Differential Revision: D45993556
fbshipit-source-id: 3dd22617cbabcc007d02965e7392eb2f5283b1b8
Summary: We need a way to specify which repos will use a preloaded commit graph and the blobstore key of the commit graph blob in that case.
Reviewed By: RajivTS
Differential Revision: D45993558
fbshipit-source-id: 4cf2ea84b72e3a50187fab3ece86e623a754d571
Summary: Adds a new command update-preloaded that tries to load a blob of the preloaded commit graph, update it with any newly added changeset edges, and re-upload it to the blobstore.
Reviewed By: mitrandir77
Differential Revision: D45993560
fbshipit-source-id: 4d14cbf091d86f165ed58fbba9305f0fa6021632
Summary: Implements a commit graph storage for preloading commit graph edges in memory. Useful for repos with complicated commit graph structures but relatively small overall size. It uses Reloader to periodically update the preloaded edges. CompactChangesetEdges are introduced to lower the memory usage by referencing other changesets using interned ids.
Reviewed By: mitrandir77
Differential Revision: D45992604
fbshipit-source-id: 5852079d10a0ba8c491e7b239d8cf4c58813dd45
Summary: These are not specific to caching so let's move them
Reviewed By: RajivTS
Differential Revision: D45993559
fbshipit-source-id: b5f127bf2997c4bf5381013df10af28f1c42c1c9
Summary:
rustls 0.21.0 finally has support for IP addresses in certs.
Lots of other crates have (in)direct dependencies on rustls so I have to upgrade those too:
* hyper, reqwest, and auxiliary crates for those have been updated
* tonic has been updated and our local patch removed (since the relevant PR was merged upstream)
Reviewed By: zertosh
Differential Revision: D45989949
fbshipit-source-id: 658c11d29859d6d36368a412dab05e3c99313ee0
Summary: During the change of mapping between repos we have to check if the new mapping applies cleanly to current repo mainline bookmark. To do that so far we've been using a binary that compared content ids for all relevant file paths. I want to speed it up but before I can comfortably do it I need to extend the test coverage. We had very little test coverage which covered only. happy paths and simplest configs.
Reviewed By: liubov-dmitrieva
Differential Revision: D45864219
fbshipit-source-id: edd78e88796e65268aa549bb443421506fe1507e
Summary: Buck2 currently has some issues with Rust doctests that should panic, failing in those tests. This diff fixes that behavior in the two doctests that we have that should panic.
Reviewed By: muirdm
Differential Revision: D45989611
fbshipit-source-id: c2a10b7976ead1517ef29caf83e2bc53ff3a9e0d
Summary:
In both the ObjectStore and in the hg BackingStore, copies of the unique_ptr
were being made. For large blobs this is particularly inefficient as
potentially several MB (if not more) of data needs to be copied. Let's fix this
by changing the BackingStore API to return a shared_ptr.
In order to make the code easier to read and write, also define 3 types:
TreePtr, BlobPtr and BlobMetadataPtr and use them in the BackingStore code.
Future changes should be done at a later point to convert the whole codebase to
using these.
Reviewed By: chadaustin
Differential Revision: D45967102
fbshipit-source-id: 6086f95456232db48a5cbec47b7cf8b14e4424ed
Summary: This diff implements the SQL logic for creating and fetching entries from `bonsai_tag_mapping` table. It also defines a new facet which will be used in gitimport, remote-gitimport and mononoke-admin tool later on. I will send a follow-up diff with tests to validate the behavior of the SQL implementation.
Reviewed By: mitrandir77
Differential Revision: D45904551
fbshipit-source-id: 31a99d89b10b39ce7aeda5f4e46b0c94ec6b60ba
Summary:
When importing a Git commit into Mononoke, we store the tag as a bookmark and the commit that the tag points to becomes a changeset in Mononoke. The bookmark then points to the newly created changeset. However there is currently no mapping from the tag to the changeset that contains the tag metadata. This table has been created for that purpose.
This diff lays the foundation for the `facet` `BonsaiTagMapping` which will be implemented in follow-up diffs.
Reviewed By: mitrandir77
Differential Revision: D45867181
fbshipit-source-id: 1c251e40b081eb38f217f5f7c85095c574263b24
Summary: Use the EnvFilter as a Filter instead of a Layer. This makes it filter events for the env logger layer, but _not_ filter events for later layers (like the SamplingLayer which outputs metrics).
Reviewed By: zzl0
Differential Revision: D45803509
fbshipit-source-id: 4eff9eb9053aad8b8be654970ded3fade5bd4a91
Summary:
The tracing collector receives tracing spans/events and sticks them in an in-memory TracingData structure. This data is used for to print out the perftrace, among other things.
Previously the collector implemented both Layer and Subscriber. However, Subscriber is not convenient since it cannot be composed with Filters. In this commit, I get rid of the Subscriber so we are only dealing with a Layer. I also got rid of the built-in LevelFilter to simplify things. It is up to the user of the TracingCollector to apply the appropriate Filter. (With no filter applied, everything will be collected.)
Reviewed By: quark-zju
Differential Revision: D45922413
fbshipit-source-id: ea1bf03ca56bc11f66e05d4298fb0bd638a650d2
Summary: We aren't going with "edenscm" as our name, so let's allow "SL" instead of "EDENSCM" for these debug env vars.
Reviewed By: zzl0
Differential Revision: D45803512
fbshipit-source-id: 39426e862c363946e70058d9414fe63b2da776d0
Summary: We see some mysterious cases where "command_duration" is not collected properly. Let's try flushing the metrics output file before exit to see if that helps (command_duration is the last metric logged, and other metrics were showing up okay).
Reviewed By: zzl0
Differential Revision: D45803511
fbshipit-source-id: 64667be09dca026a0a11abb935b39b190f16efa5
Summary: This way it gets recorded even for ctrl-c.
Reviewed By: zzl0
Differential Revision: D45803510
fbshipit-source-id: b99a5c2e2f61557c3c161f0d34797fc98fb00565
Summary:
getEntryAttributes did a mount lookup for every single path. That's
unnecessary: have the Thrift method do a mount lookup, ensure the
mount stays alive, and pass it down.
Reviewed By: kmancini
Differential Revision: D45973970
fbshipit-source-id: 68c5038b229b5b2e4946e6a34dd6ceaabd3fcf11
Summary:
We have three ways to look up a mount in a Thrift handler: by MountId,
with a Thrift field reference, and as a string parameter. Add
`lookupMount` overloads that handle all of them.
Reviewed By: kmancini
Differential Revision: D45973903
fbshipit-source-id: fb6d6ac1bf5001dbc111875aa4aa257d1bcccc59
Summary:
We have several legacy conditional includes that are no longer
necessary. Remove another.
Reviewed By: xavierd
Differential Revision: D45927567
fbshipit-source-id: 05bea9a94b249104c26893cfc0017fa472643ce5
Summary:
Remove a class of boilerplate by introducing a lookupMount function
that takes the two common Thrift mount identifiers and returns an
EdenMountHandle.
Reviewed By: kmancini
Differential Revision: D45924483
fbshipit-source-id: 2f919c4525ba8c82018d9b7c2ca4ee361d924791
Summary:
I want to use EdenMountHandle in EdenServiceHandler without pulling in
EdenServer.h.
Reviewed By: xavierd
Differential Revision: D45924297
fbshipit-source-id: 2043374d513c01423cd6f785b2c4e2b36d937676
Summary:
Having a strict ObjectID format is quite inconvenient. We will need to introduce a new ObjectID format for Eden x Sparse, so it's in our best interest to remove the ObjectID format restrictions before hand.
This will allow us to place the high entropy data (proxy hash in our case) in any location in the ObjectId without causing a ton of hash collisions. This will enable us to introduce FilteredObjectIDs in the form:
`<tree_or_blob_byte><filterset_id><path><ObjectId>`
where the `<ObjectId>` contains the high entropy bits we need to hash.
Reviewed By: xavierd
Differential Revision: D45793298
fbshipit-source-id: 77385e32f63d5f3d1fc37b72b9971f5717cbd872
Summary:
We are considering changing the ObjectID hash function to no-longer be constant time. Instead, it might iterate over the bytes of the ID and "mix-in" contents from each 8 byte chunk into a final hash.
In order to measure the performance hit this might have, we need to benchmark both long ObjectIds and short ObjectIDs. This diff introduces a benchmark to test hashing ObjectIDs of length 240 characters long, which is a realistic size of our current ObjectIDs.
Reviewed By: chadaustin
Differential Revision: D45798645
fbshipit-source-id: 988442555f48968edf67517aa25b55ef636de610
Summary:
Now that we have NFS support on Windows, we can enable
debugOutstandingNfsCalls.
Reviewed By: genevievehelsel
Differential Revision: D45260222
fbshipit-source-id: 38e7ec6cd38601bd940904695cc69ce2193b98c1
Summary:
Now the the ifdefs are isolated to the PrivHelper, we can remove some
from EdenServiceHandler.
Reviewed By: mshroyer
Differential Revision: D45260210
fbshipit-source-id: d0394e45320c516290a6c4323400cc054e76d612
Summary:
We already had a pretend PrivHelper on Windows. Remove the stub
methods on Windows and provide a Windows implementation of PrivHelper
where most methods are no-ops but the mounts throw a NOT_IMPLEMENTED
error.
Reviewed By: kmancini
Differential Revision: D45260187
fbshipit-source-id: 87ca8679947372e484c345acdd708a17dbb8235e
Summary: As title mentions. This should give us test / build issues on Windows, as previously we could
Reviewed By: quark-zju
Differential Revision: D45711111
fbshipit-source-id: 18b251fd02c9b8aa9aa4bd3c69ca633b617f7449
Summary: These tests only really run on Linux; they don't even build properly on other OSes, so let's disable them.
Reviewed By: muirdm
Differential Revision: D45926534
fbshipit-source-id: 3a1d66f3f5632888c1a63a7e9fa2f0b96816acb7
Summary:
I was hoping this would shake out some dependency issues, but they
must be triggered by a later diff in the stack.
Reviewed By: xavierd
Differential Revision: D45927428
fbshipit-source-id: ec29b331f561f9bcfe1daa6856ac8cca67e01d39
Summary:
I ended up in a crazy situation where the CMake build was failing to
link because `target_link_libraries` had a cycle. Fix that by
preventing cycles in the first place. CMake is the gift that keeps on
giving.
Reviewed By: xavierd
Differential Revision: D45927359
fbshipit-source-id: 6a378f7935195e42b3446249091898370d6e2ee5
Summary:
enums can contain arbitrary values, so gcc (and older clang?) complain
about the possibility that none of these cases match.
Reviewed By: xavierd
Differential Revision: D45927298
fbshipit-source-id: 0cd0a946d0faf7442a1a8d5de388a7d4b6dbb274
Summary:
The name `rev` is used for revision numbers. It was used as a hex node in the
code. Let's make it use binary `node` explicitly to avoid confusion.
Reviewed By: muirdm
Differential Revision: D45898261
fbshipit-source-id: 7f6fc04e1e5a6aaef46dd31c3aca9d494cbf488a
Summary:
Make fastlog uses a regular generator and just one generatorset, instead of a
background thread + queue + nested generatorsets. The "combinator" that takes
threads becomes unnecessary after D45898263 and is removed.
This avoids the SIGABRT issue which could be reproduced relatively easily like:
export CHGDISABLE=1
# likely SIGABRT in the first 10 runs
for i in `seq 100`; do hg log -r 'max(follow(fbcode/buck2,master))' --pager=off || { echo FAIL!; return 1 }; done
Example SIGABRT backtraces in gdb:
(gdb) r log -r 'max(follow(fbcode/buck2,master))' --pager=off --verbose --debug --config fastlog.debug=remote
Starting program: hg log -r 'max(follow(fbcode/buck2,master))' --pager=off --verbose --debug --config fastlog.debug=remote
[Thread debugging using libthread_db enabled]
...
thread '<unnamed>' panicked at 'panic in a function that cannot unwind', library/core/src/panicking.rs:123:5
note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace
thread caused non-unwinding panic. aborting.
Thread 14 "hg" received signal SIGABRT, Aborted.
[Switching to Thread 0x7fffc7a00700 (LWP 785327)]
0x00007ffff6a4eacf in raise () from /lib64/libc.so.6
(gdb) bt
0 0x00007ffff6a4eacf in raise () from /lib64/libc.so.6
1 0x00007ffff6a21ea5 in abort () from /lib64/libc.so.6
2 0x0000555557fb9677 in std::sys::unix::abort_internal () at library/std/src/sys/unix/mod.rs:350
3 0x0000555557fb1eaa in std::panicking::rust_panic_with_hook () at library/std/src/panicking.rs:711
4 0x0000555557fb1b42 in std::panicking::begin_panic_handler::{{closure}} () at library/std/src/panicking.rs:581
5 0x0000555557fb0226 in std::sys_common::backtrace::__rust_end_short_backtrace () at library/std/src/sys_common/backtrace.rs:150
6 0x0000555557fb1892 in rust_begin_unwind () at library/std/src/panicking.rs:579
7 0x0000555557fdb223 in core::panicking::panic_nounwind_fmt () at library/core/src/panicking.rs:93
8 0x0000555557fdb2d1 in core::panicking::panic_nounwind () at library/core/src/panicking.rs:123
9 0x0000555557fdb3f3 in core::panicking::panic_cannot_unwind () at library/core/src/panicking.rs:171
10 0x00005555563ae8c4 in cpython::conversion::ToPyObject::with_borrowed_ptr (self=0x7fffc79ff158, f=..., py=...) at ../../../third-party/rust/vendor/cpython-0.7.1/src/conversion.rs:55
11 cpython::objectprotocol::ObjectProtocol::call (py=..., args=..., kwargs=..., self=<optimized out>) at ../../../third-party/rust/vendor/cpython-0.7.1/src/objectprotocol.rs:214
12 pythreading::RGeneratorIter::next_internal (self=<optimized out>, py=..., iternext=<optimized out>) at src/lib.rs:405
13 0x00005555563b2264 in pythreading::RGeneratorIter::__next__ (py=...) at src/lib.rs:389
14 0x00005555563b3714 in pythreading::RGeneratorIter::create_instance::TYPE_OBJECT::wrap_unary::{{closure}} (py=...)
at ../../../third-party/rust/vendor/cpython-0.7.1/src/py_class/slots.rs:321
15 cpython::function::handle_callback::{{closure}} () at ../../../third-party/rust/vendor/cpython-0.7.1/src/function.rs:220
16 std::panicking::try::do_call (data=<optimized out>) at /rustc/84c898d65adf2f39a5a98507f1fe0ce10a2b8dbc/library/std/src/panicking.rs:487
17 std::panicking::try (f=...) at /rustc/84c898d65adf2f39a5a98507f1fe0ce10a2b8dbc/library/std/src/panicking.rs:451
18 0x00005555563b2609 in std::panic::catch_unwind (f=...) at /rustc/84c898d65adf2f39a5a98507f1fe0ce10a2b8dbc/library/std/src/panic.rs:140
19 cpython::function::handle_callback (_location=..., f=..., _c=...) at ../../../third-party/rust/vendor/cpython-0.7.1/src/function.rs:218
20 pythreading::RGeneratorIter::create_instance::TYPE_OBJECT::wrap_unary (slf=0x7fffefa613d0) at ../../../third-party/rust/vendor/cpython-0.7.1/src/py_class/slots.rs:318
21 0x00007ffff65e1518 in _PyEval_EvalFrameDefault () from /lib64/libpython3.8.so.1.0
22 0x00007ffff659f02f in _PyFunction_Vectorcall () from /lib64/libpython3.8.so.1.0
23 0x00007ffff65e11dd in _PyEval_EvalFrameDefault () from /lib64/libpython3.8.so.1.0
24 0x00007ffff659f02f in _PyFunction_Vectorcall () from /lib64/libpython3.8.so.1.0
25 0x00007ffff65e11dd in _PyEval_EvalFrameDefault () from /lib64/libpython3.8.so.1.0
26 0x00007ffff659f02f in _PyFunction_Vectorcall () from /lib64/libpython3.8.so.1.0
27 0x00007ffff659fb24 in method_vectorcall () from /lib64/libpython3.8.so.1.0
28 0x00007ffff659798f in PyObject_Call () from /lib64/libpython3.8.so.1.0
29 0x00007ffff662ec5e in t_bootstrap () from /lib64/libpython3.8.so.1.0
30 0x00007ffff65ee5a4 in pythread_wrapper () from /lib64/libpython3.8.so.1.0
31 0x00007ffff5c081ca in start_thread () from /lib64/libpthread.so.0
32 0x00007ffff6a39e73 in clone () from /lib64/libc.so.6
(gdb) info threads
Id Target Id Frame
1 Thread 0x7ffff7fe6d80 (LWP 784691) "hg" 0x00007ffff650f274 in visit_decref () from /lib64/libpython3.8.so.1.0
2 Thread 0x7ffff4a00700 (LWP 785063) "ctrl-c" 0x00007ffff6b1f9b4 in read () from /lib64/libc.so.6
3 Thread 0x7ffff4600700 (LWP 785066) "tokio-runtime-w" 0x00007ffff6b2ee87 in epoll_wait () from /lib64/libc.so.6
....
10 Thread 0x7fffee600700 (LWP 785073) "tokio-runtime-w" 0x00007ffff6a399bd in syscall () from /lib64/libc.so.6
11 Thread 0x7fffee200700 (LWP 785074) "rust-progress" 0x00007ffff6af9868 in nanosleep () from /lib64/libc.so.6
13 Thread 0x7fffd4a00700 (LWP 785135) "hg" 0x00007ffff6b2667f in select () from /lib64/libc.so.6
* 14 Thread 0x7fffc7a00700 (LWP 785327) "hg" (Exiting) 0x00007ffff6a4eacf in raise () from /lib64/libc.so.6
(gdb) thread 1
[Switching to thread 1 (Thread 0x7ffff7fe6d80 (LWP 784691))]
0 0x00007ffff650f274 in visit_decref () from /lib64/libpython3.8.so.1.0
(gdb) bt
0 0x00007ffff650f274 in visit_decref () from /lib64/libpython3.8.so.1.0
1 0x00007ffff650bc0f in func_traverse () from /lib64/libpython3.8.so.1.0
2 0x00007ffff6528e94 in collect.constprop () from /lib64/libpython3.8.so.1.0
3 0x00007ffff664f192 in _PyGC_CollectNoFail () from /lib64/libpython3.8.so.1.0
4 0x00007ffff664f43a in PyImport_Cleanup () from /lib64/libpython3.8.so.1.0
5 0x00007ffff66519ff in Py_FinalizeEx () from /lib64/libpython3.8.so.1.0
6 0x000055555627f9d5 in hgcommands::python::py_finalize () at src/python.rs:136
7 <hgcommands::hgpython::HgPython as core::ops::drop::Drop>::drop::{{closure}} () at src/hgpython.rs:237
8 tracing::span::Span::in_scope (self=0x7fffffffafc0, f=...) at ../../../third-party/rust/vendor/tracing-0.1.37/src/span.rs:1102
9 0x000055555615651a in <hgcommands::hgpython::HgPython as core::ops::drop::Drop>::drop (self=<optimized out>) at src/hgpython.rs:237
10 0x0000555556130936 in core::ptr::drop_in_place<hgcommands::hgpython::HgPython> () at /rustc/84c898d65adf2f39a5a98507f1fe0ce10a2b8dbc/library/core/src/ptr/mod.rs:490
11 hgcommands::run::dispatch_command (io=0x7fffffffcde0, dispatcher=..., cwd=..., in_scope=..., start_time=...) at src/run.rs:240
12 hgcommands::run::run_command::{{closure}} () at src/run.rs:148
13 0x000055555612dbbd in hgcommands::run::run_command (args=..., io=0x7fffffffcde0) at src/run.rs:133
14 0x00005555561242da in hgmain::main () at src/main.rs:114
Note it involves threads, GC, rust-cpython, and `Py_Finalize`.
See also https://github.com/dgrunwald/rust-cpython/pull/244.
Reviewed By: muirdm
Differential Revision: D45898265
fbshipit-source-id: ce94763c7249f83237472f1fc4b4abad1011230c
Summary:
It does not seem like the code path would ever need to handle len(paths) > 1
cases. So let's simplify the code accordingly.
For example, when you run `hg log PATH1 PATH2`, the underlying revset is
`follow(PATH1) or follow(PATH2)`. Each follow revset only gets 1 path.
I guess the multi-path support was needed before migrating to the follow revset
in D14764074.
Reviewed By: muirdm
Differential Revision: D45898264
fbshipit-source-id: 05d1aed8d08741fe555e7eda4e4b3a2fd797833e
Summary:
The `RGenerator` and `RGeneratorIter` types keep Python objects internally.
Let's be a good citizen and tell CPython the object graph so CPython can
properly GC related objects.
Reviewed By: muirdm
Differential Revision: D45898262
fbshipit-source-id: da2b04ec6f7928c486f3f691885bf2ed8cb06055
Summary: Add a function to query the (optional) ObjectId from VirtualInode.
Reviewed By: kmancini
Differential Revision: D45673165
fbshipit-source-id: 72dadaf4cbd5120c75548734aca2bb8ae715b8e2
Summary:
Add a function to query the (optional) ObjectId from an arbitrary
inode.
Reviewed By: kmancini
Differential Revision: D45673053
fbshipit-source-id: 23630638ba94bbd1925a39193fa125df04abebad
Summary:
I noticed some situations where we don't hold the root inode for the
duration of an asynchronous operation. To make that easier, I
introduced an EdenMountHandle.
Port EdenServer::getMount() to return EdenMountHandle, which
simplifies some Thrift service handlers.
Reviewed By: kmancini
Differential Revision: D45891887
fbshipit-source-id: 99dfaa4aaf609c8b237cceeaa15b91bd26981d02
Summary:
Asynchronous operations that must ensure an EdenMount (and its root)
are usable for the duration must hold a reference to the root's
InodePtr, even if they only need the EdenMount.
To make this relationship less implicit, introduce an EdenMountHandle
which is effectively the same as the previous
`pair<EdenMountPtr, TreeInodePtr>`, but more clearly documents the intent
is to preserve the usability of EdenMount and its root inode.
This also allows us to decouple that relationship in the future,
should we want to.
For now, only use EdenMountHandle in getMountPoints. Next, I'll switch
`getMount` to use it.
Reviewed By: kmancini
Differential Revision: D45830176
fbshipit-source-id: 832dd96b9a6fe04fabbb5af0ecbed0173f9d2a2b
Summary: This diff implements the `create_git_tag` endpoint introduced in the last diff. The primary logic is implemeted as part of the `mononoke_api::create_annotated_tag` method so no new logic is introduced here. The `create_annotated_tag` does not yet store the mapping of the created changeset object with the tag name
Reviewed By: mitrandir77
Differential Revision: D45654021
fbshipit-source-id: 3ebd8d7b67a59935f646f5ba4287e14a096f82d1
Summary: The `create_git_tag` endpoint introduced in this diff is responsible for creating a changeset that represents the metadata of a git tag and create a DB-level mapping between the changeset-representing-the-tag and the changeset that the tag bookmark points to. This diff just introduces the skeleton, the ne xt diff in the stack will implement the core logic
Reviewed By: mitrandir77
Differential Revision: D45643823
fbshipit-source-id: 3b25c8a9382a364667c262961ed8506344988d49
Summary: This test was failing on Windows due to `working_copy.remove` not failing silently anymore. Given that the exact thing that it is testing doesn't work, it's better to just remove it.
Reviewed By: quark-zju
Differential Revision: D45833748
fbshipit-source-id: 952ca8a49fcdde8b5345d27eab20cedc3b979d7a
Summary: There are some cases where the Curl crate might not support HTTP V2, but will still try to use V2 regardless. This diff makes it fall back to Any (whatever the Curl crate considers best and available) instead.
Reviewed By: muirdm
Differential Revision: D45778450
fbshipit-source-id: 7811d1f30f75fab09f7bb0b478f44c730bbfe12b
Summary: Sometimes the log size changes a bit, which was making this test flaky on Linux and fail in most cases on Windows. This diff fixes that issue.
Reviewed By: muirdm
Differential Revision: D45762283
fbshipit-source-id: d16aedc2e0bfd858f1c5d3060339ae6e106fcb5b
Summary:
By default, `debugexportstack -r wdir()` exports tracked file changes. In the
ISL use-case, we'd like to add a "chunk selector" for files in the working copy.
The "chunk selector" would like to know the file contents regardless of whether
files are in `?`, `M`, `A`, `!`, `R` states.
This diff adds a `--assume-tracked` flag to support this use-case. Basically,
this flag can be used to make files in `!` or `?` states exported as if they
were `R` and `A` states.
Reviewed By: muirdm
Differential Revision: D45787979
fbshipit-source-id: 812a389ffe6d01b8a4200754bdc38c49b775c67e
Summary:
I noticed that `workingfilectx` handles renames properly. There is no need to
use `wctx`.
Reviewed By: muirdm
Differential Revision: D45787980
fbshipit-source-id: b46364305bd551b462445a8719fde1d77b694581
Summary:
The EdenMount::getObjectStore gave the assumption to callers that the
ObjectStore lived longer than the EdenMount. Since this assumption is implicit
and not explicit, there is no way to guarantee it by just reading the code in a
local fashion. It forces the reader/auditor to understand the code in its
entirety. Unfortunately, EdenFS contains more of these than can be kept in
memory which leads to bugs and use-after-free.
This can be avoided by breaking the implicit lifetime assumption and simply
returning the shared_ptr. If the caller needs to keep the ObjectStore around,
they can do so explicitely which makes reading the code easier.
Reviewed By: chadaustin
Differential Revision: D45831168
fbshipit-source-id: 8bdb8e708308a8a220e3130d2fc51854c8556cb1
Summary:
This will be used in a later diff outside of EdenMount.cpp, thus let's move it
to its own file.
Reviewed By: chadaustin
Differential Revision: D45831170
fbshipit-source-id: 1cc55e1ae580ee7f02e3d9c6a717da4751c955e6
Summary:
When a BlobMetadata fails to fetch, the fetch promise is set to a `nullptr` to
force the higher level BackinStore to fetch the full blob. Unfortunately,
`HgImportRequestQueue::markImportAsFinished` attempts to deep copy that
`nullptr` leading to a crash.
Reviewed By: chadaustin
Differential Revision: D45873681
fbshipit-source-id: 3f5b777a3671cf53dd9d605dca2e119eabe3e625
Summary: Here we implement the logic needed to bump QPS counters so we can shift traffic cross regionally with cslb
Reviewed By: mzr
Differential Revision: D45731719
fbshipit-source-id: d5df034d40588d47f19e121b21d606637dcdc41f
Summary: Add fallback logic for MetadataRenameFinder in case users forget to record copy information in the header
Reviewed By: muirdm
Differential Revision: D45865166
fbshipit-source-id: 991a71718b9e149fa1cd23fe33dd254f22e2f366
Summary: Those functions will be used for fallback logic in next diff
Reviewed By: muirdm
Differential Revision: D45865165
fbshipit-source-id: 73a4df33ff1dc407c53bf98fc95c10e1bff2501c
Summary:
RenameFinderInner is like a base struct for MetadataRenameFinder and ContentSimilarityRenameFinder.
It is introduced for code reuse between those two file based rename finders.
Reviewed By: muirdm
Differential Revision: D45865167
fbshipit-source-id: 66302c7dcad87fcd36e19ad2649d7fc4d42098b6
Summary: We already have a ContentSimilarityRenameFinder, MetadataRenameFinder sounds more appropriate than the original SaplingRenameFinder, since both rename finders now describes what information they are using for finding renames.
Reviewed By: muirdm
Differential Revision: D45827713
fbshipit-source-id: 9d9e5576cec676afbdd661333591085bef70d996
Summary: We have timeout in seconds (not a limit of number of tries), and it's usually around a minute. Doesn't make a lot of sense to sleep with 0.1. It also spams the logs a lot.
Reviewed By: YousefSalama
Differential Revision: D45810132
fbshipit-source-id: b638d086526da2450251fe412acead20c0bf5579
Summary:
The user doesn't really care if a runlog update failed. This is expected to happen sometimes on Windows since the update will fail if the file is underlying runlog file is open (by another process).
Also, add a couple retries to the final runlog update on Windows to increase the chance we close out the entry.
Reviewed By: sggutier
Differential Revision: D45831199
fbshipit-source-id: 664e14695fdf3a7363dafc7523cef78c9fafd84c
Summary:
I noticed this special path in `eden rm` misspelled "still". I also
cleaned up the grammar. Sentence fragments aren't capitalized and, to
make the path clearer, I removed the trailing period and split the
message across multiple lines.
(Separately, I think this is special path is not hit as often as was
intended.)
Reviewed By: xavierd
Differential Revision: D45828487
fbshipit-source-id: 183ccde081cb022abbc9e972f00bae8e5b9f33c0
Summary: There are a few categories that get collected into the "hg_errors" table. Make the fields more consistent so they always include exception_type, exception_msg and a new field "source" to make it more obvious where the error was emitted.
Reviewed By: grakkpl
Differential Revision: D45817135
fbshipit-source-id: a568e4c68fc51806fc5016b7a3e7e0a51ed9047d