mirror of
https://github.com/facebook/sapling.git
synced 2024-10-10 16:57:49 +03:00
8840f92d07
Summary: While trying to repro a user report (https://fburl.com/jqvm320o), I ran into a new hg error: P151186623, i.e.: ``` KeyError: 'Key not found HgId(Key { path: RepoPathBuf("fbcode/thrift/facebook/test/py/TARGETS"), hgid: HgId("55713728544d5955703d604299d77bb1ed50c62d") })' ``` After some investigation (and adding a lot of prints), I noticed that this was trying to query the EdenAPI server for this filenode. That request should succeed, given Mononoke knows about this filenode: ``` [torozco@devbig051]~/fbcode % mononoke_exec mononoke_admin fbsource --use-mysql-client filenodes by-id fbcode/thrift/facebook/test/py/TARGETS 55713728544d5955703d604299d77bb1ed50c62d mononoke_exec: Using config stage prod (set MONONOKE_EXEC_STAGE= to override) I1126 08:10:02.089614 3697890 [main] eden/mononoke/cmdlib/src/args/mod.rs:1097] using repo "fbsource" repoid RepositoryId(2100) I1126 08:10:02.995172 3697890 [main] eden/mononoke/cmds/admin/filenodes.rs:137] Filenode: HgFileNodeId(HgNodeHash(Sha1(55713728544d5955703d604299d77bb1ed50c62d))) I1126 08:10:02.995282 3697890 [main] eden/mononoke/cmds/admin/filenodes.rs:138] -- path: FilePath(MPath("fbcode/thrift/facebook/test/py/TARGETS")) I1126 08:10:02.995341 3697890 [main] eden/mononoke/cmds/admin/filenodes.rs:139] -- p1: Some(HgFileNodeId(HgNodeHash(Sha1(ccb76adc7db0fc4a395be066fe5464873cdf57e7)))) I1126 08:10:02.995405 3697890 [main] eden/mononoke/cmds/admin/filenodes.rs:140] -- p2: None I1126 08:10:02.995449 3697890 [main] eden/mononoke/cmds/admin/filenodes.rs:141] -- copyfrom: None I1126 08:10:02.995486 3697890 [main] eden/mononoke/cmds/admin/filenodes.rs:142] -- linknode: HgChangesetId(HgNodeHash(Sha1(dfe46f7d6cd8bc9b03af8870aca521b1801126f0))) ``` Turns out, the success rate for this method is actually 0% — out of thousands of requests, not a single one succeeded :( https://fburl.com/scuba/edenapi_server/cma3c3j0 The root cause here is that the server side is not properly deserializing requests (actually finding that was a problem of its own, I filed T80406893 for this). If you manage to get it to print the errors, it says: ``` {"message":"Deserialization failed: missing field `path`","request_id":"f97e2c7c-a432-4696-9a4e-538ed0db0418"} ``` The reason for this is that the server side tries to deserialize the request as if it was a `WireHistoryRequest`, but actually it's a `HistoryRequest`, so all the fields have different names (we use numbers in `WireHistoryRequest`). This diff fixes that. I also introduced a helper method to make this a little less footgun-y and double-checked the other callsites. There is one callsite right now that looks like it might be broken (the commit one), but I couldn't find the client side interface for this (I'm guessing it's not implemented yet), so for now I left it as-is. Reviewed By: StanislavGlebik Differential Revision: D25187639 fbshipit-source-id: fa993579666dda762c0d71ccb56a646c20aee606 |
||
---|---|---|
.. | ||
contrib | ||
distutils_rust | ||
doc | ||
edenscm | ||
edenscmnative | ||
exec | ||
hgcache_size_logger | ||
i18n | ||
lib | ||
newdoc | ||
pystubs | ||
slides | ||
tests | ||
.editorconfig | ||
.flake8 | ||
.gitignore | ||
COPYING | ||
gen_version.py | ||
hgeditor | ||
Makefile | ||
README.rst | ||
setup3.py | ||
setup.py |
Mercurial ========= Mercurial is a fast, easy to use, distributed revision control tool for software developers. Basic install:: $ make # see install targets $ make install # do a system-wide install $ hg debuginstall # sanity-check setup $ hg # see help Running without installing:: $ make local # build for inplace usage $ ./hg --version # should show the latest version See https://mercurial-scm.org/ for detailed installation instructions, platform-specific notes, and Mercurial user information.