Commit Graph

11 Commits

Author SHA1 Message Date
Xavier Deguillard
436a847a79 win: make read callback fully asynchronous
Summary:
Similarly to the other callbacks, this makes the main function return to
ProjectedFS as soon as the future is created which will allow for it to be
interrupted in a subsequent diff.

Reviewed By: fanzeyi

Differential Revision: D23745754

fbshipit-source-id: 2d77d0eacfe0d37eb9075bf9f0660e4f4af77e8f
2020-09-23 09:43:34 -07:00
Xavier Deguillard
49e13b3db6 win: make the queryFileName callback asynchronous
Summary: Similarly to the other one, this will make it possible to interrupt.

Reviewed By: fanzeyi

Differential Revision: D23643100

fbshipit-source-id: 0daab1cec94d0e177bb707d97bf928b05d5d24a3
2020-09-16 18:59:26 -07:00
Xavier Deguillard
5512d7c09f win: make the getPlaceholder callback asynchronous
Summary: Similarly to the other callback, this will make it possible to interrupt.

Reviewed By: fanzeyi

Differential Revision: D23643101

fbshipit-source-id: 9f9a48e752a850c63255b8867b980163cb6a92c9
2020-09-16 18:59:26 -07:00
Xavier Deguillard
ff16c758d2 win: make the opendir callback asynchronous
Summary:
The opendir callback tend to be the most expensive of all due to having to
fetch the content of all the files. This leads to some frustrating UX as the
`ls` operation cannot be interrupted. By making this asynchronous, the slow
operation can be interrupted. The future isn't cancelled and thus it will
continue to fetch in the background, this will be tackled in a future diff.

Reviewed By: fanzeyi

Differential Revision: D23630462

fbshipit-source-id: f1c4a9fbd9daa18ca4b8f4837c5241a37ccfbcf9
2020-09-16 18:59:25 -07:00
Xavier Deguillard
0904c05535 win: plumb PrjfsRequestContext in the notification callback
Summary:
Now that all the pieces are in place, we can plumb the request context in. For
now, this adds it to only one callback as I figure out more about it and tweak
it until I have something satisfactory. There are some rough edges with it that
I'm not entirely happy about, but as I change the notification callback to be
more async, I'm hoping to make more convenient to use and less clanky.

Reviewed By: fanzeyi

Differential Revision: D23505508

fbshipit-source-id: d5f12e22a8f67dfa061b8ad82ea718582c323b45
2020-09-16 18:59:24 -07:00
Xavier Deguillard
37df55b270 telemetry: consolidate Fuse/PrjFS stats in ChannelThreadStats
Summary:
This helps make RequestData slightly more generic by depending less on Fuse
specific types/code.

Reviewed By: chadaustin

Differential Revision: D23467487

fbshipit-source-id: 830f8269e2114c2968dcc49d3b5574e687191e4d
2020-09-02 15:28:39 -07:00
Xavier Deguillard
e5558221ac store: plumb CMD_CAT_TREE
Summary:
With Mercurial now supporting CMD_CAT_TREE for efficiently fetching and reading
trees, we can plumb this onto EdenFS. At startup time, we detect whether
Mercurial supports CMD_CAT_TREE and use that method, otherwise, we fallback to
the old CMD_FETCH_TREE.

Reviewed By: wez

Differential Revision: D23044953

fbshipit-source-id: 9aea5c5b82e97039a75ef18976a155dcb6e150bc
2020-08-12 08:17:25 -07:00
Xavier Deguillard
07df8faf5e win: when creating a file/directory, create the parents too
Summary:
As opposed to FUSE, ProjectedFS sends notifications for file/directory creation
after the fact, and for directory that means these will be visible on disk before
EdenFS may be aware of it. While EdenFS usually process it quickly, a heavily
multi-threaded application that tries to concurrently create a directory
hierarchy may end up sending notifications to EdenFS in a somewhat out of order
fashion.

Since this should be a very rare occurence, we make this a very slow path by
being optimistic and calling `getInode` first, and then only if that fails, we
aggressively create all the parent directories. During a buck build of ~1k
jobs, this happened only 3 times.

If we fully think this through, this change doesn't fully fix the race, as a
similar race can now happen when a create and remove/rename operations are
concurrent. However, a client performing these operations concurrently is
either aware that this is racy and should handle these properly, or is most
likely buggy. Both of these should significantly reduce the likelyhod of this
happening, thus, I'm leaving this unfixed for now.

To better understand how frequently this happens, I've added a stat counter.
For now, these aren't published to ODS, but this will be tackled later.

Reviewed By: wez

Differential Revision: D22783484

fbshipit-source-id: ea3aafc2f77b65d3967f697f68114921d5909137
2020-07-29 12:17:17 -07:00
Katie Mancini
3a035094f8 Record Mercurial tree import time
Summary: - added logging only around the import tree call to capture non-queue related wait time

Reviewed By: chadaustin, fanzeyi

Differential Revision: D20207472

fbshipit-source-id: d88bb34ce224a26ff2be100d7789ddeff608006d
2020-03-03 11:44:28 -08:00
Katie Mancini
52e211fe8e Record Mercurial file import time
Summary:
- added logging only around the import blob call to capture non-queue related wait time
- added to `test_reading_file_gets_file_from_hg` in `integration.stats_test.HgBackingStoreStatsTest`  to test import blob logging in addition to the get blob loging

(not yet done for importing trees, will do in next diff)

Reviewed By: chadaustin

Differential Revision: D20201215

fbshipit-source-id: c89281fe7d3d6e89d111ac8cce9014adff44ac40
2020-03-03 11:44:27 -08:00
Chad Austin
65c93484e2 rename tracing to telemetry
Summary: Tracing was not an accurate name for what this directory had become. So rename it to telemetry.

Reviewed By: wez

Differential Revision: D17923303

fbshipit-source-id: fca07e8447d9b9b3ea5d860809a2d377e3c4f9f2
2019-10-15 13:39:41 -07:00