Commit Graph

19921 Commits

Author SHA1 Message Date
Rajiv Sharma
ffa2587292 Use fb303 extension in Admin tool
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
2023-05-24 14:21:51 -07:00
Youssef Ibrahim
c344d94066 edenapi: gate streaming commit graph endpoint behind a tunable
Summary: Makes it easier to rollback

Reviewed By: mitrandir77

Differential Revision: D46156526

fbshipit-source-id: eae70801069d09ab03b3b683712d9353fb1e5a43
2023-05-24 14:14:19 -07:00
Genevieve (Genna) Helsel
23832acbf3 default to using buffered overlay
Reviewed By: chadaustin

Differential Revision: D45541124

fbshipit-source-id: bc6392cfd6ae8aa592a5e5546bd7d14df394a6dc
2023-05-24 13:11:13 -07:00
Xavier Deguillard
c88363c998 store: remove BlobMetadata computation/caching when getting blob
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
2023-05-24 10:26:51 -07:00
Rajiv Sharma
eec4c1cdd4 Modify bookmark get admin command to handle annotated tags
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
2023-05-24 07:11:26 -07:00
Rajiv Sharma
3c830eaeb0 Add factory builder methods for BonsaiTagMapping
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
2023-05-24 07:11:26 -07:00
Rajiv Sharma
d3afd74c9a Utilize ContentMetadataV2 in metadata-diff endpoint
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
2023-05-24 03:55:49 -07:00
Zhaolong Zhu
c6c3779843 remotefilelog: remove unnecessary file ancestor process
Summary: Remove unnecessary file ancestor process and their cache.

Reviewed By: muirdm

Differential Revision: D45898747

fbshipit-source-id: a540a937f98a63a93a71f5bb3e5befe0a56de1d8
2023-05-23 19:31:53 -07:00
Chad Austin
e858234e94 add OBJECT_ID attribute to getAttributesFromFilesV2
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
2023-05-23 19:12:06 -07:00
Chad Austin
3495e3731c split readdir integration tests into a separate file
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
2023-05-23 19:12:06 -07:00
Genevieve (Genna) Helsel
1148997dcb migrate edenfsctl fsck to C++
Reviewed By: chadaustin

Differential Revision: D44473843

fbshipit-source-id: 01c46e1cd50b73e6c0d13d00fd42a7da81abc01c
2023-05-23 13:33:07 -07:00
Youssef Ibrahim
97ab9db5df commit_graph: replace usages of LeastCommonAncestorsHint::is_ancestor and ReachabilityIndex::query_reachability (conditional on a tunable) (except in ChangesetPathContext)
Summary: :O

Reviewed By: mitrandir77

Differential Revision: D45607344

fbshipit-source-id: 2a0438cd7cff0e782eab4843f0436b5400d773aa
2023-05-23 11:26:11 -07:00
Youssef Ibrahim
77cb2d63e4 replace slice_repository with CommitGraph::slice_ancestors and delete commit_traversal directory
Summary: saintelmosfire

Reviewed By: mitrandir77

Differential Revision: D45607345

fbshipit-source-id: 638eb537b8f475fc9e6ae85dfbeabf8290105d1e
2023-05-23 11:26:11 -07:00
Youssef Ibrahim
608dc8dd0e commit_graph: implement slice_ancestors
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
2023-05-23 11:26:11 -07:00
Youssef Ibrahim
f4e7296e5e commit_graph_types: move ChangesetFrontier to a separate module
Summary: Makes slightly more sense

Reviewed By: mitrandir77

Differential Revision: D45607346

fbshipit-source-id: 6b505796da96ff24cd7d555290dcf341f93c797f
2023-05-23 11:26:11 -07:00
Youssef Ibrahim
6205656019 commit_graph: split CommitGraph impl
Summary: My fingers are tired from scrolling

Reviewed By: mitrandir77

Differential Revision: D45607349

fbshipit-source-id: fe366797a37fbd1682ca917d6bdd39c88195c8e9
2023-05-23 11:26:11 -07:00
Youssef Ibrahim
938110f792 mononoke_api: use new commit graph common_base conditional on a tunable
Summary: :O

Reviewed By: mitrandir77

Differential Revision: D45607348

fbshipit-source-id: 8a0bbec488961007912d1ef865439a023c388437
2023-05-23 11:26:11 -07:00
Youssef Ibrahim
d9b60cffa2 commit_graph: implement common_base
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
2023-05-23 11:26:11 -07:00
Stiopa Koltsov
f67b9e37bf Upgrade plist
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
2023-05-23 08:49:53 -07:00
Mateusz Kwapich
a7769f4207 add retries to move_bookmark call
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
2023-05-23 07:33:20 -07:00
Rajiv Sharma
89792c6232 Unit tests for bonsai_tag_mapping
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
2023-05-23 04:02:13 -07:00
Youssef Ibrahim
b9c436cdba repo_factory: construct preloaded commit graph depending on repo config
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
2023-05-22 15:15:01 -07:00
Youssef Ibrahim
8f1a4a8c38 add repo config for specifying preloaded commit graph blobstore key
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
2023-05-22 15:15:01 -07:00
Youssef Ibrahim
8b2561119a newadmin: add command for updating/building preloaded commit graph blob
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
2023-05-22 15:15:01 -07:00
Youssef Ibrahim
1b8ae05406 commit_graph: implement PreloadedCommitGraphStorage
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
2023-05-22 15:15:01 -07:00
Youssef Ibrahim
2ddd469c08 commit_graph: move thrift types and conversions to commit_graph_types
Summary: These are not specific to caching so let's move them

Reviewed By: RajivTS

Differential Revision: D45993559

fbshipit-source-id: b5f127bf2997c4bf5381013df10af28f1c42c1c9
2023-05-22 15:15:01 -07:00
Mat Hostetter
68f72f1a4d Remove unused raw-api feature from dashmap crate
Reviewed By: zertosh

Differential Revision: D46058815

fbshipit-source-id: a586471098b243102b8eb11d41e630d11259f88a
2023-05-22 10:38:20 -07:00
Pierre Chevalier
5dbaa8f12e non-oss work 50
Reviewed By: RajivTS

Differential Revision: D46024882

fbshipit-source-id: 188ae4add1b3a1da551c661750bade25b15315f4
2023-05-22 04:31:14 -07:00
Pierre Chevalier
1f7b379a25 non-oss work 46/n
Differential Revision: D46003720

fbshipit-source-id: 4b93b2b2a290c445b94a51d011095ddecef77355
2023-05-22 04:31:14 -07:00
Dimitris Iliopoulos
e3744f957f Update autocargo component on FBS:master
Reviewed By: zertosh

Differential Revision: D46033336

fbshipit-source-id: bb12a53114d23b383eb9468b6f4a3cc3866d806f
2023-05-19 14:28:58 -07:00
Pedro Rittner
e8e3ea7d20 Upgrade rustls to 0.21 across all third party packages
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
2023-05-19 12:39:46 -07:00
Mateusz Kwapich
d0a1036317 test for repo working copy verification
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
2023-05-19 08:51:02 -07:00
Andres Suarez
cde0feed40 update clap-3 and clap_complete-3
Summary: Update to latest versions.

Reviewed By: AndreasBackx

Differential Revision: D45947093

fbshipit-source-id: 64ac9ac86a3180e0de57b79408829ef920706c0c
2023-05-19 06:51:50 -07:00
Saul Gutierrez
fb978486b6 tests: fix should_panic issues with Windows in doctests
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
2023-05-18 12:59:11 -07:00
Xavier Deguillard
2e9cce82d5 store: make BackingStore return shared_ptr instead of unique_ptr
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
2023-05-18 12:30:08 -07:00
Rajiv Sharma
1b26065084 Implement BonsaiTagMapping in SQL
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
2023-05-18 11:08:05 -07:00
Rajiv Sharma
4e18ad54ce Create bonsai_tag_mapping table
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
2023-05-18 11:08:05 -07:00
Muir Manders
dc1cf18c43 sampling: fix sampling to be compatible with tracing output
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
2023-05-18 11:02:58 -07:00
Muir Manders
abbdfbe2e7 tracing: simplify tracing collector
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
2023-05-18 11:02:58 -07:00
Muir Manders
3d682b2aee env vars: allow SL_LOG in addition to EDENSCM_LOG
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
2023-05-18 11:02:58 -07:00
Muir Manders
21f09a7a45 sampling: flush output file before exit
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
2023-05-18 11:02:58 -07:00
Muir Manders
b2606b45f0 sampling: write "command_duration" metric in atexit handler
Summary: This way it gets recorded even for ctrl-c.

Reviewed By: zzl0

Differential Revision: D45803510

fbshipit-source-id: b99a5c2e2f61557c3c161f0d34797fc98fb00565
2023-05-18 11:02:58 -07:00
Chad Austin
c01b1fda33 remove redundant mount lookups in getEntryAttributes
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
2023-05-18 09:44:50 -07:00
Chad Austin
7cf357b00f use lookupMount for all of the mount ID Thrift types
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
2023-05-18 09:44:50 -07:00
Chad Austin
22a21ebb09 remove a conditional include
Summary:
We have several legacy conditional includes that are no longer
necessary. Remove another.

Reviewed By: xavierd

Differential Revision: D45927567

fbshipit-source-id: 05bea9a94b249104c26893cfc0017fa472643ce5
2023-05-18 09:44:50 -07:00
Chad Austin
33a05c1def remove some unused includes
Reviewed By: xavierd

Differential Revision: D45924539

fbshipit-source-id: 441271fbfa63578b6f237ab792fa9fc52092157b
2023-05-18 09:44:50 -07:00
Chad Austin
8730a7299a migrate to lookupMount and have it return EdenMountHandle
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
2023-05-18 09:44:50 -07:00
Chad Austin
1e39c10150 move EdenMountHandle into its own sources
Summary:
I want to use EdenMountHandle in EdenServiceHandler without pulling in
EdenServer.h.

Reviewed By: xavierd

Differential Revision: D45924297

fbshipit-source-id: 2043374d513c01423cd6f785b2c4e2b36d937676
2023-05-18 09:44:50 -07:00
Chad Austin
8c7994003d break EdenServer.h's dependency on EdenMount.h
Reviewed By: kmancini

Differential Revision: D45924234

fbshipit-source-id: e979f7e3c4e902c48c7ea8b9ea8eb0bc5565a572
2023-05-18 09:44:50 -07:00
Chad Austin
a82565ae2d remove some includes from EdenServer.h
Summary: I keep noticing unnecessarily recompilations when I change files.

Reviewed By: kmancini

Differential Revision: D45924117

fbshipit-source-id: 445590fae6be11ef35d40c7295e64493d8c57160
2023-05-17 19:16:48 -07:00
Chad Austin
75a5678622 remove some ifdefs by introducing a platform-independent UsageService class
Summary:
Naming the concept allows us to decouple implementation details and
imagine future implementations.

Reviewed By: kmancini

Differential Revision: D45917739

fbshipit-source-id: d0d0a023c2d978c8a509af0e7187295b4c9c413b
2023-05-17 19:16:48 -07:00
Dimitris Iliopoulos
12df87352f upgrade packages from toml-5 (0.5.8 fork) -> toml (0.7.3)
Summary:
The fixes bellow are because of one of 4 reasons:
1. [`toml::from_slice`](https://docs.rs/toml/0.5.8/toml/de/fn.from_slice.html) and [`toml::to_vec`](https://docs.rs/toml/0.5.8/toml/ser/fn.to_vec.html)  have been removed and replaced in the current version by [`toml::from_str`](https://docs.rs/toml/0.7.3/toml/fn.from_str.html) and [`toml::to_string`](https://docs.rs/toml/0.7.3/toml/fn.to_string.html)
2. [`toml::Spanned::span`](https://docs.rs/toml/0.7.3/toml/struct.Spanned.html#method.span) now returns a `Range<usize>` and not a `(usize, usize)` like it used to ([here](https://docs.rs/toml/0.5.8/toml/struct.Spanned.html#method.span))
3. The internal representation for parsed TOML via [`toml_edit`](https://docs.rs/toml_edit/latest/toml_edit/) uses `"` instead of `'` for representing string values
4. TOML parsing errors are now multi-line errors and need to be accounted for in tests

Reviewed By: zertosh, shayne-fletcher

Differential Revision: D45896591

fbshipit-source-id: 403790674c7449da9f7322d69ec3030369310aab
2023-05-17 18:52:14 -07:00
Michael Cuevas
61c02ae9ef remove entropy location assumptions from ObjectId hash
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
2023-05-17 17:47:42 -07:00
Michael Cuevas
e691b04a24 Modify ObjectCacheBench to test both long and short IDs
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
2023-05-17 17:47:42 -07:00
Youssef Ibrahim
a36957c27a idmap: only do one iteration of slow idmap test before retrying fast test in adjust_candidate_id
Reviewed By: quark-zju

Differential Revision: D45865137

fbshipit-source-id: 32d1c3b8effec7e6b268c639b874716f00571255
2023-05-17 11:37:05 -07:00
Chad Austin
24379db627 enable debugOutstandingNfsCalls on Windows
Summary:
Now that we have NFS support on Windows, we can enable
debugOutstandingNfsCalls.

Reviewed By: genevievehelsel

Differential Revision: D45260222

fbshipit-source-id: 38e7ec6cd38601bd940904695cc69ce2193b98c1
2023-05-17 09:07:32 -07:00
Chad Austin
3f844667ab remove some ifdefs from EdenServiceHandler
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
2023-05-17 09:07:32 -07:00
Chad Austin
c508cc8302 use the same PrivHelper interface on all platforms
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
2023-05-17 09:07:32 -07:00
Rajiv Sharma
7e23b7d515 Sharding non-oss work [3/N]
Differential Revision: D45909814

fbshipit-source-id: 3f2f7144ac0f97f0812b5f03764375a7a451f7c7
2023-05-17 07:12:52 -07:00
Rajiv Sharma
8e7beaa612 Sharding non-oss work [2/N]
Differential Revision: D45908882

fbshipit-source-id: 7d911e1c07c8f9584934b3ed8464fa98a2050d85
2023-05-17 07:12:52 -07:00
Rajiv Sharma
31b89d3613 Sharding non-oss work [1/N]
Differential Revision: D45908028

fbshipit-source-id: 1159ba504676c4f49682822b8d7ad03c0efb34bd
2023-05-17 07:12:52 -07:00
Saul Gutierrez
7fd6895703 enable contbuild for Windows
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
2023-05-17 06:49:59 -07:00
Saul Gutierrez
cb6946de98 tests: disable edenfs-client tests outside of Linux
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
2023-05-17 06:49:59 -07:00
Chad Austin
85735aed3d cmake: sort subdirectories
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
2023-05-16 20:14:36 -07:00
Chad Austin
5915548f7e cmake: disallow circular dependencies
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
2023-05-16 20:14:36 -07:00
Chad Austin
6fcf6fa3a2 fix a 'control reaches end of non-void function' warning
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
2023-05-16 20:14:36 -07:00
Jun Wu
3c8b31ed14 fastlog: rename rev to node
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
2023-05-16 20:05:57 -07:00
Jun Wu
1d243d0f92 fastlog: avoid background threads that might SIGABRT
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
2023-05-16 20:05:57 -07:00
Jun Wu
80a7bf019c fastlog: make main logic take 1 path only
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
2023-05-16 20:05:57 -07:00
Jun Wu
64cffa0e54 fastlog: remove LocalIteratorThread
Summary: It's not used anywhere. Nothing sets `fastlog.scan-local-repo`.

Reviewed By: muirdm

Differential Revision: D45898263

fbshipit-source-id: d8262cf7665e2513481a6583c4f5b3b990e2880c
2023-05-16 20:05:57 -07:00
Jun Wu
05c699b80a pythreading: integrate RGenerator with Python GC
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
2023-05-16 20:05:57 -07:00
Chad Austin
5dbf02a176 add VirtualInode::getObjectId
Summary: Add a function to query the (optional) ObjectId from VirtualInode.

Reviewed By: kmancini

Differential Revision: D45673165

fbshipit-source-id: 72dadaf4cbd5120c75548734aca2bb8ae715b8e2
2023-05-16 18:13:53 -07:00
Chad Austin
0a45ac1ddd add an InodeBase::getObjectId accessor
Summary:
Add a function to query the (optional) ObjectId from an arbitrary
inode.

Reviewed By: kmancini

Differential Revision: D45673053

fbshipit-source-id: 23630638ba94bbd1925a39193fa125df04abebad
2023-05-16 18:13:53 -07:00
Chad Austin
598baa101c use EdenMountHandle in getMount
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
2023-05-16 15:26:07 -07:00
Chad Austin
ddd3282c61 allow scheduleCallbackOnMainEventBase to run on any thread
Summary:
Localizing knowledge of EventBase implementation details makes logic
easier to follow. Allow calling scheduleCallbackOnMainEventBase on any
thread.

Reviewed By: kmancini

Differential Revision: D45837412

fbshipit-source-id: c169f380ee7b41b38f025eae299a3135bf643fdb
2023-05-16 15:26:07 -07:00
Chad Austin
f6b3196b58 introduce EdenMountHandle
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
2023-05-16 15:26:07 -07:00
Rajiv Sharma
1632631220 Implement endpoint for creating tagged changeset
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
2023-05-16 14:27:05 -07:00
Rajiv Sharma
adf49a3fce Introduce endpoint for creating tagged changeset
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
2023-05-16 14:27:05 -07:00
Egor Tkachenko
37467c8c26 non-oss work 44/n
Differential Revision: D45909224

fbshipit-source-id: 92c61604eaf4091d2806878cade9bbe93c845b70
2023-05-16 14:23:43 -07:00
Saul Gutierrez
18bca6626c tests: remove pyworker::test_remove_while_open_with_no_sharing Rust unit test
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
2023-05-15 17:37:14 -07:00
Saul Gutierrez
7ba1210693 tests: fix revisionstore tests for Windows
Reviewed By: muirdm

Differential Revision: D45784899

fbshipit-source-id: d060ff84003a0a53211a9ea20bc966870c1d7971
2023-05-15 17:37:14 -07:00
Saul Gutierrez
94eeda9173 http-client: make HttpVersion fall back from V2 to Any if V2 is not available in the current build
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
2023-05-15 17:37:14 -07:00
Saul Gutierrez
a35d6f7f0b tests: fix lib:metalog:test_repair Rust unit test
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
2023-05-15 17:37:14 -07:00
Jun Wu
acd971e1ea debugstack: add a way to export extra files in debugexportstack -r wdir()
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
2023-05-15 16:12:48 -07:00
Jun Wu
cd18124164 debugstack: simplify importstack working copy file handling
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
2023-05-15 16:12:48 -07:00
Xavier Deguillard
6b40cc2ac9 inodes: remove an implicit lifetime of ObjectStore
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
2023-05-15 15:34:14 -07:00
Xavier Deguillard
780fa33138 inodes: move TreeLookupProcessor out of EdenMount.cpp
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
2023-05-15 15:34:14 -07:00
Xavier Deguillard
ce5f49e4d7 store: don't deep copy nullptr
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
2023-05-15 13:35:12 -07:00
Clara Rull
d18542d9e7 Bump Qps counter
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
2023-05-15 09:29:04 -07:00
Zhaolong Zhu
0de6dbda85 copytrace: add fallback to content similarity logic
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
2023-05-15 09:20:14 -07:00
Zhaolong Zhu
8929a82026 copytrace: abstract out functions for generating file keys
Summary: Those functions will be used for fallback logic in next diff

Reviewed By: muirdm

Differential Revision: D45865165

fbshipit-source-id: 73a4df33ff1dc407c53bf98fc95c10e1bff2501c
2023-05-15 09:20:14 -07:00
Zhaolong Zhu
fa9cdfdb3f copytrace: abstract out RenameFinderInner
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
2023-05-15 09:20:14 -07:00
Zhaolong Zhu
f275f8dca9 copytrace: rename SaplingRenameFinder to MetadataRenameFinder
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
2023-05-15 09:20:14 -07:00
Jan Mazur
02e0f65f44 sleep 1 instead of sleep 0.1 in wait_for_server
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
2023-05-15 08:36:58 -07:00
Muir Manders
749e4fcb40 runlog: silence error output
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
2023-05-15 06:48:06 -07:00
Liubov Dmitrieva
b19cf7bf72 improve our debugging experience with printing common in stack trace
Summary: improve our debugging experience with printing common in stack trace

Reviewed By: YousefSalama

Differential Revision: D45862811

fbshipit-source-id: 6e41cf741adf39a2dd09d17451bf8bbaafd216be
2023-05-15 05:59:01 -07:00
Pierre Chevalier
d462edcfc5 non-oss work 38/n
Differential Revision: D45814635

fbshipit-source-id: 6b2597a6fc431c17f8e61d1007e5dc1d08237995
2023-05-15 02:16:47 -07:00
Chad Austin
bf5660efc1 fix a typo and clean up some grammar in eden rm
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
2023-05-14 10:47:25 -07:00
Pierre Chevalier
007a0e2ddb non-oss work 35/n
Differential Revision: D45812278

fbshipit-source-id: 3b30280a944d80757d4998e1538d4843edffc346
2023-05-14 04:44:36 -07:00
Muir Manders
0566fd6ef8 hg_errors: add more info to log messages
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
2023-05-12 11:08:50 -07:00