Commit Graph

55579 Commits

Author SHA1 Message Date
Pavel Aslanov
24998bbc19 remove BlobRepo::upload_file
Summary: remove `BlobRepo::upload_file`

Reviewed By: krallin

Differential Revision: D19742438

fbshipit-source-id: 319e4a55f940ec74e0971dc1ceb54da986f1280a
2020-02-05 08:21:01 -08:00
Pavel Aslanov
a847531484 remove BlobRepo::get_bonsai_changeset
Summary: remove `BlobRepo::get_bonsai_changeset`

Reviewed By: farnz

Differential Revision: D19742232

fbshipit-source-id: 760ef8d89f7a42feed18aec94c08b2a002f14be4
2020-02-05 07:43:55 -08:00
Mark Thomas
47f125dab3 scs_server: log client headers to scuba
Summary: Log `client_id`, `client_correlator`, `client_type` and `proxy_client_id` to scuba.

Reviewed By: krallin

Differential Revision: D19741717

fbshipit-source-id: c5dea17900141de2f43802bb36839bc7c8a824f8
2020-02-05 07:31:06 -08:00
Thomas Orozco
84aebf00f4 mononoke/fastreplay: sample Scuba logging
Summary:
This updates fastreplay to support sampling of the samples we log to Scuba.
This lets us control the volume we log to Scuba.

Reviewed By: farnz

Differential Revision: D19722223

fbshipit-source-id: 2e43f201a3e5930f5f6a29749c35e0e0dea341d2
2020-02-05 06:24:01 -08:00
Thomas Orozco
142b803911 common/rust/scuba: add support for sampling
Summary:
This adds support for sampling scuba samples, and assigns their weight properly
so that Scuba will report the right number of hits. The sampling is determined
at the point where `sampled()` is called, which means we can e.g. create a
Scuba sample and thread it through for a whole request and either everything
will be sampled, or nothing.

I haven't refactored our Multiplex blob to use this just yet, since it's
architecturally a bit trickier to use this there.

Note: I'll rebase on D19599013 if we land that first.

Reviewed By: ahornby

Differential Revision: D19722224

fbshipit-source-id: b5464937a29f73868fbdc8396d507bac1555af78
2020-02-05 06:24:00 -08:00
Pavel Aslanov
6a3b3172f4 remove BlobRepo::get_file_content*
Summary: remove `BlobRepo::get_file_content*`

Reviewed By: farnz

Differential Revision: D19724764

fbshipit-source-id: d334a97a443fec59f5e155c6bfc01d87a158ea3a
2020-02-05 05:32:07 -08:00
svcscm
a092c71abc Updating submodules
Summary:
GitHub commits:

27f6f2f7b1
72c5450838

Reviewed By: yns88

fbshipit-source-id: de5347420f30bf061d65bf0326ca52381aa5fdfe
2020-02-05 00:27:14 -08:00
Jun Wu
1bcfec407d py3: remove pycompat3
Summary:
Use `abc.ABC` from Python 3 stdlib directly. The definition matches
`pycompat3.py`:

  class ABC(metaclass=ABCMeta):
      pass

The following changes are reverted since they're no longer necessary:

  D19732319 "[hg] py3: fix windows build"
  D19703778 "[hg] py3: exclude mercurial/pycompat3.py from Python 2 builds"
  D19703779 "[hg] py3: exclude pycompat3.py from Buck-based Python 2 builds"

Reviewed By: simpkins, singhsrb

Differential Revision: D19739075

fbshipit-source-id: 8c1e3727e8a88ff5f7232270d528d690523b1824
2020-02-04 22:15:16 -08:00
svcscm
25af01135c Updating submodules
Summary:
GitHub commits:

5d4b1cac38

Reviewed By: yns88

fbshipit-source-id: e962c9b901abb179c74b474c09955a115feecf26
2020-02-04 21:03:41 -08:00
Saurabh Singh
8f5ec4b183 test-status-inprocess: make the test output more stable
Summary:
Write output using `ui` object instead of using `print` to improve
robustness.

Reviewed By: quark-zju

Differential Revision: D19738486

fbshipit-source-id: 4da80ce7efef44e9c5694ed71a55b7d64629166c
2020-02-04 20:36:42 -08:00
Saurabh Singh
5c37bfd373 nointerrupt: make output more stable
Summary:
Printing via `ui` object instead of directly to the `stderr` makes the
output more consistent.

Reviewed By: quark-zju

Differential Revision: D19738355

fbshipit-source-id: 384bf2de11f2ae7b5264ec5d94b041502c4ef7fb
2020-02-04 20:36:42 -08:00
Jun Wu
7316c4cc22 cpython-ext: add a way to wrap Rust Write object into a Python object
Summary:
The library already has a way to wrap a Python object into a Rust object that
exposes the Rust Read/Write interface. This is the reverse direction for
the Write interface.

The initial intention is to expose Rust stdout as described in D19702533.
However, I found Python's `sys.stdout.buffer` also enforces utf-8 encoding
on Windows (unless PYTHONLEGACYWINDOWSSTDIO is set). So Python's
stdout actually behaves similarly with Rust's stdout on Windows and is okay
to use. That said, it's still useful to have this abstraction, for streampager [1]
integration.

[1]: https://github.com/markbt/streampager/

Reviewed By: sfilipco

Differential Revision: D19716127

fbshipit-source-id: ba39898122561d9a49b7080ee95d7c940540eb40
2020-02-04 18:41:13 -08:00
Wez Furlong
650575122d eden: fix fuse init on linux kernel 5.4 and up
Summary:
1fb027d759
changed the kernel behavior to reject reads smaller than 8KB,
even for requests that would never need to be that large.

That causes eden to fail to start up on eg: Fedora 31 with a 5.4 kernel.

This commit adds some padding to satisfy this new check.

Reviewed By: chadaustin

Differential Revision: D19736893

fbshipit-source-id: 926456d72124b186976ee9a8a21242e93c26f790
2020-02-04 18:18:44 -08:00
David Tolnay
d358c71e6d Update to Rust 1.41.0
Reviewed By: jsgf

Differential Revision: D19656956

fbshipit-source-id: ef791638021ae55375ca35ca191cf1b8a3cc5d7f
2020-02-04 18:03:03 -08:00
David Tolnay
2b4b151905 Update to Rust 1.41.0
Reviewed By: jsgf

Differential Revision: D19656956

fbshipit-source-id: ef791638021ae55375ca35ca191cf1b8a3cc5d7f
2020-02-04 18:02:47 -08:00
svcscm
005ebfe28b Updating submodules
Summary:
GitHub commits:

fa0d7fcfa8

Reviewed By: yns88

fbshipit-source-id: cb06aca5f1add7d78ea33725f90360ad0883e8d2
2020-02-04 17:56:29 -08:00
Durham Goode
d3227d34c2 py3: remove forced decoding of environment variable
Summary:
On python 2, os.environ is expected to be bytes, so let's remove the
forced decoding. This broke run-tests.py on Windows.

Reviewed By: singhsrb

Differential Revision: D19737218

fbshipit-source-id: d4782eea279275f57cc91bc412a2d74857002cc1
2020-02-04 17:31:45 -08:00
svcscm
825d70f702 Updating submodules
Summary:
GitHub commits:

b2ba6b8cc4
f3fb63081d
b4165b07d5
788e9c67f9
11b313b0b8

Reviewed By: yns88

fbshipit-source-id: 61d790852b5440738595b26292fb66c961be45d1
2020-02-04 17:19:07 -08:00
David Tolnay
48597dcb4e Update rustfmt and reformat fbsource
Summary:
```
$ tools/third-party/rustfmt/rustfmt --version
rustfmt 1.4.11-nightly (1838235 2019-12-03)
```

Reviewed By: zertosh

Differential Revision: D19704678

fbshipit-source-id: fe8707e964495e76746edcb8b68e34fc1411f52a
2020-02-04 17:14:27 -08:00
David Tolnay
34a520536a Update rustfmt and reformat fbsource
Summary:
```
$ tools/third-party/rustfmt/rustfmt --version
rustfmt 1.4.11-nightly (1838235 2019-12-03)
```

Reviewed By: zertosh

Differential Revision: D19704678

fbshipit-source-id: fe8707e964495e76746edcb8b68e34fc1411f52a
2020-02-04 17:14:27 -08:00
svcscm
5e9733d096 Updating submodules
Summary:
GitHub commits:

619d2503cb
c442208177
75d9b18eba
ed5142083a

Reviewed By: yns88

fbshipit-source-id: 11a53fea064f8e40c2a89d3068421d7cad231d00
2020-02-04 16:36:54 -08:00
Arun Kulshreshtha
fb4764d17e edenapi_server: add request routing
Summary: Add a handler to the EdenAPI server for basic request routing.

Reviewed By: xavierd

Differential Revision: D19726776

fbshipit-source-id: 906a538ebfd48532c2488feb9f99747690f3351b
2020-02-04 16:31:11 -08:00
Arun Kulshreshtha
625025a6a6 lfs_server: import Middleware trait from gotham_ext
Summary: Make the LFS server depend on `gotham_ext` for its Middleware trait and Handler struct. The code itself was previously copied from here, so there should be no functional changes.

Reviewed By: krallin

Differential Revision: D19714661

fbshipit-source-id: 64f3b230c97219c7419cec4e92d30c2ee537c724
2020-02-04 16:31:11 -08:00
Arun Kulshreshtha
5ca1a925b5 gotham_ext: factor out common HTTP boilerplate into new crate
Summary:
A lot of the code in the LFS server is generally useful for any Gotham-based HTTP server, so let's create a place to put the common pieces. Mononoke's HTTP-based services like the LFS server and EdenAPI server can then depend on this common crate.

In this initial diff, I've simply factored out the `Middleware` trait, as well as the custom Handler struct, which right now appears to simply be a mechanism to run the middleware before and after each request.

Given that none of this code appears to be LFS-specific, I hope this is reasonable. I'm open to suggestions for naming things; for now I've named the new crate `gotham_ext` since it's built on Gotham, but I could see us using another name if we intend to move in the direction of plain `hyper` in the future.

In later diffs, I intend to start moving over some of the more general Middleware from the LFS server to the new crate (though LFS-specific Middleware will remain a part of the LFS server code).

Reviewed By: krallin

Differential Revision: D19714662

fbshipit-source-id: 21494d18be659a8ec399c61eb22ee10185efcc14
2020-02-04 16:31:11 -08:00
Durham Goode
fd47fd9202 py3: fix windows build
Summary:
We added pycompat3.py which only parses in Python 3. We need to
exclude it from the Windows build as well.

Unfortunately, the Windows build users PyZipFile.writepy which writes an entire
directory. Let's copy in the implementation from Python 3 which allows us to
filter out certain files.

Reviewed By: xavierd

Differential Revision: D19732319

fbshipit-source-id: 4cebb434d052c51d9ae0dccdec5eadd1f412f9e5
2020-02-04 15:40:35 -08:00
Carolyn Busch
d49c251d13 py3 iteritems -> pycompat.iteritems
Summary: More replacements of dict.iteritems with pycompat.iteritems(dict) for py3 compatibility.

Reviewed By: singhsrb

Differential Revision: D19704211

fbshipit-source-id: 544cb292c0241a293fc4ab83c3d9472dcf4328b6
2020-02-04 15:29:39 -08:00
svcscm
f454dbcfa4 Updating submodules
Summary:
GitHub commits:

23231f3828
e3c02bbb85
be23f69942

Reviewed By: yns88

fbshipit-source-id: 1d9206a6792da5a95b0998ef57ac7a8b75295e31
2020-02-04 15:29:38 -08:00
svcscm
e6a5eaadf0 Updating submodules
Summary:
GitHub commits:

8f3d7019bb
a5df50cf5c
b896a52075
3a073234da
7c05bee055
90f0aa9665
5cdd1abbb9

Reviewed By: yns88

fbshipit-source-id: 70dd062814f68bda77e119bb9deaefbf71c551e6
2020-02-04 13:00:09 -08:00
Saurabh Singh
3d78cca814 util: remove redundant 'timed' function
Summary:
`timed` has been replaced by the `timefunction` in util.

I have also removed the existing usages because they seemed relevant only
during the development.

Reviewed By: quark-zju

Differential Revision: D19727919

fbshipit-source-id: 58c466f02ac2a5bf7096948b17b49ceb26fc1fd9
2020-02-04 12:33:40 -08:00
Durham Goode
16efd0a0e0 py3: fix osx tests
Summary:
The path normalization OSX logic was using unicode, and when it
switched to use pycompat in D19613690 it stopped using unicode, which broke it.
Let's roll it back.

Reviewed By: singhsrb

Differential Revision: D19726322

fbshipit-source-id: fa7bfacdf41dfedbcfef2fdb5ccb826196101e61
2020-02-04 12:19:13 -08:00
Stanislau Hlebik
7291baa7e8 mononoke: revert D19683369
Summary:
This diff causes problems when new code (i.e. the one that generated linknodes
during hg changeset generation) and old code (i.e. the one that doesn't
generate linknodes) run at the same time.

Reviewed By: ikostia

Differential Revision: D19720991

fbshipit-source-id: b2278543020ed8e356b0ba95b61e1c91f5cd5de7
2020-02-04 11:48:27 -08:00
Pavel Aslanov
6e7c2ced4b remove BlobRepo::get_file_content_metadata
Summary:
- remove BlobRepo::get_file_content_metadata
- and method associated with alias resolutions

Reviewed By: krallin

Differential Revision: D19722457

fbshipit-source-id: d45e1cbb4ec769426e2ed7c6cc32173e4dbbac57
2020-02-04 10:25:15 -08:00
Thomas Orozco
7b30ea88fc mononoke/fastreplay: start ptail instead of piping it in
Summary:
We start Fastreplay with some cache warmup. During this time, it doesn't make
sense to go and start ptail, since we're not ready to process its output.

Instead, let's start ptail when we're ready. Piping from stdin is still
possible by not providing a command at all.

Reviewed By: ahornby

Differential Revision: D19723470

fbshipit-source-id: 64f58d9eced4a68fd8238b03b9234f3569215237
2020-02-04 09:32:17 -08:00
Stanislau Hlebik
c115c0c721 mononoke: make cache_warmup more resilient to missing linknode
Summary:
At the moment missing linknodes causes cache warmup to fail. While missing
linknode is not great, failing to start up is much worse - we can make Mononoke
completely unusuable.

This diff instead adds logging of missing filenodes. It also makes sure that we
derive filenodes before using them.

Reviewed By: ikostia

Differential Revision: D19722924

fbshipit-source-id: 10d23506731c45cfaaadee911be62189104c8036
2020-02-04 09:00:06 -08:00
Stanislau Hlebik
50a93cf5d1 mononoke: remove unnecessary async block
Reviewed By: farnz

Differential Revision: D19719718

fbshipit-source-id: 56b9edfcbbc92ffc1a5cba467d18394921f46285
2020-02-04 08:39:35 -08:00
Jun Wu
2203d207a6 tests: do not set stdin to /dev/null
Summary:
This makes it possible to use `--debug` to enter ipdb interactive debug
sessions on crash (which was a new run-tests.py feature added by
D19581174).

For example, I was able to use it to debug a crash in test-lfs-to-mononoke.t
when debugging D19702533:

  Traceback (most recent call last):
    ...
    File "buck-out/dev/gen/eden/scm/__hg__/runtime_resources/__default__/eden/scm/hglib/edenscm/mercurial/ui.py", line 648, in _write
      self.fout.write(encodeutf8("".join(msgs)))
    File "buck-out/dev/gen/eden/scm/__hg__/runtime_resources/__default__/eden/scm/hglib/edenscm/mercurial/pycompat.py", line 168, in encodeutf8
      assert isinstance(s, bytes)
  AssertionError
  > buck-out/dev/gen/eden/scm/__hg__/runtime_resources/__default__/eden/scm/hglib/edenscm/mercurial/pycompat.py(168)encodeutf8()
      167         # type: (bytes) -> bytes
  --> 168         assert isinstance(s, bytes)
      169         return s
  ipdb> up
  ipdb> p msgs
  (u'lfs: uploading e2fff2ce58d585b4b0572e0a323f9e7e5f98cc641489e12c03c401d05d0e350d (1.95 KB)\n',)
  ipdb> up (a few times)
  ipdb> p obj
  {u'oid': u'e2fff2ce58d585b4b0572e0a323f9e7e5f98cc641489e12c03c401d05d0e350d', u'size': 2000, u'authenticated': False, u'actions': {u'upload': {u'href': u'http://localhost:46705/repo/upload/e2fff2ce58d585b4b0572e0a323f9e7e5f98cc641489e12c03c401d05d0e350d/2000'}}}

Without this diff, the `ipdb>` prompt will be ended immediately since it's
reading from /dev/null.

Reviewed By: krallin

Differential Revision: D19709731

fbshipit-source-id: 76cefbf192c4592884e05afee81146963954c5d6
2020-02-04 08:26:35 -08:00
Pavel Aslanov
22e76e8860 remove BlobRepo::get_file_size
Summary: remove `BlobRepo::get_file_size`

Reviewed By: farnz

Differential Revision: D19696679

fbshipit-source-id: 33e940b1d6e4a1546fa808ca0902df8ccf893e18
2020-02-04 07:01:10 -08:00
Pavel Aslanov
5ea1f9318a remove BlobRepo::get_file_parents
Summary: remove `BlobRepo::get_file_parents`

Reviewed By: farnz

Differential Revision: D19694212

fbshipit-source-id: 6812a3821e6e809eb332a2b4d22b83688083231e
2020-02-04 07:01:09 -08:00
Pavel Aslanov
d5c9ffaa17 remove BlobRepo::get_file_envelope
Summary:
- Make `HgFileNodeId` an instance of `Loadable<Value=HgFileEnvelope>`.
- Remove `BlobRepo::get_file_envelope`

Reviewed By: StanislavGlebik

Differential Revision: D19694237

fbshipit-source-id: 67ec51e39cd6da944d505bfb69f087a4b70c544d
2020-02-04 07:01:09 -08:00
Thomas Orozco
c7baeefa23 common/rust/manifold: convert to async / await
Summary:
The underlying Thrift client code is already async / await, but the layer on
top of it is not. This isn't ideal, since it results in a lot of undesirable
clones happening all over the place (e.g. every key is cloned multiple times).

This fixes that by updating the wrapper code to async / await.

Reviewed By: farnz

Differential Revision: D19695708

fbshipit-source-id: b4c1b6fd6bf4d998ca6187c4cdde67294329d181
2020-02-04 06:56:22 -08:00
Stanislau Hlebik
43e5d4f968 mononoke: add missing phases initialization
Reviewed By: krallin

Differential Revision: D19717875

fbshipit-source-id: b77b07cb081108bcc238990c823c196ddf00314a
2020-02-04 01:39:54 -08:00
svcscm
ea723b3eb5 Updating submodules
Summary:
GitHub commits:

bedf2a2d54

Reviewed By: yns88

fbshipit-source-id: 5fa3d59b1854af6d0e99518c5d8fd1bff731583d
2020-02-03 23:05:10 -08:00
Adam Simpkins
0e1437c823 py3: add some additional type annotations on functions writing file data
Summary:
Add a few additional type annotations on some functions.
This did require some minor code restructuring in `filestore.setfile()` to
work around pyre's unwillingness to unwrap `Optional` member variables.

Reviewed By: quark-zju

Differential Revision: D19715243

fbshipit-source-id: 8078329c1e4a50ad0aa6c765d42a89b5ed58e7bf
2020-02-03 21:36:56 -08:00
Adam Simpkins
0657c35391 py3: add more vfs-related type annotations
Summary:
Add more type annotations to vfs.py and some of the platform-specific
functions that it calls.

This did catch a couple of cases where string/bytes conversion were not being
done properly in Python 3.

Reviewed By: quark-zju

Differential Revision: D19678717

fbshipit-source-id: b3979cc5e0668ddbb93372dee25ef02ea1867d6f
2020-02-03 21:36:56 -08:00
svcscm
d8f1c0b0eb Updating submodules
Summary:
GitHub commits:

5a3956bd9f
db67a81b72
4c8fa7af24
7330ec0ff1

Reviewed By: yns88

fbshipit-source-id: 00d407bccddae9fffd9cf8986426e7d8e3c78cca
2020-02-03 18:53:59 -08:00
Jun Wu
9602130aab py3: chg: fix compatibility
Summary:
Fix various type issues when running chg under Python 3.
Enable chg in setup3.py build.

This should make tests run faster. For example, test-rebase-detach.t
now completes in 8 seconds, down from 29 seconds.

Reviewed By: xavierd

Differential Revision: D19702535

fbshipit-source-id: 8928b1b920b9b52fd03dc86f996da18f2405f146
2020-02-03 18:26:57 -08:00
Jun Wu
3e0b781197 py3: only use binary stdin/stdout/stderr
Summary:
Drop stdoutbytes/stdinbytes. They make things unnecessarily complicated
(especially for chg / Rust dispatch entry point).

The new idea is IO are using bytes. Text are written in utf-8 (Python 3) or
local encoding (Python 2). To make stdout behave reasonably on systems not
using utf-8 locale (ex. Windows), we might add a Rust binding to Rust's stdout,
which does the right thing:
- When writing to stdout console, expect text to be utf-8 encoded and do proper decoding.
- Wehn writing to stdout file, write the raw bytes without translation.

Note Python's `sys.stdout.buffer` does not do translation when writing to stdout console
like Rust's stdout.

For now, my main motivation of this change is to fix chg on Python 3.

Reviewed By: xavierd

Differential Revision: D19702533

fbshipit-source-id: 74704c83e1b200ff66fb3a2d23d97ff21c7239c8
2020-02-03 18:26:57 -08:00
Durham Goode
16d4739981 fsmonitor: catch watchman issue and fallback
Summary:
My earlier refactor moved a watchmanclient.getcurrentclock() call out
of a "try/except Exception" block. This meant any watchman errors broke the hg
status entirely, instead of falling back to the old status path.

Let's add the logic around this watchman path.

Reviewed By: sfilipco

Differential Revision: D19709391

fbshipit-source-id: bfb0221ba405a926babddaf73c8e70924e4d9b25
2020-02-03 18:04:25 -08:00
Jasmeet Bagga
a7246e9781 Factor our hw_port_stats_fb303 lib
Summary:
Implementation based on what we do in bcm layer
for reporting (non histogram) port stat counters. Abstracting
this lib out so we can reuse this code in both SAI and bcm
layers. Plus pulling this out of BcmPort makes it much
easier to unit test this code.

Reviewed By: boryas

Differential Revision: D19676641

fbshipit-source-id: 88aa20f20339729f5387500bcf6084871f4e7caa
2020-02-03 17:37:05 -08:00
svcscm
99387283e9 Updating submodules
Summary:
GitHub commits:

68d1a8790b
b1758cc2a0
38887da845
4d396b1953
ccbe2b93d5
973085cbfc

Reviewed By: yns88

fbshipit-source-id: b3e90c88df073fb57ce916276e017e949e57e9d0
2020-02-03 17:31:19 -08:00