sapling/eden/scm/lib
Arun Kulshreshtha f8aa0e47c2 http-client: report setup errors for streaming requests
Summary:
For async requests, we perform a blocking request in a separate thread, and stream the results back through a channel. However, if the curl handle for the request is dropped before starting the request (for example, because of a configuration error), this function would return a `oneshot::Canceled` error (from the channel consumer) instead of the real error message from the IO thread.

This diff fixes the issue by ensuring that the function waits for and returns the error message from the IO thread in the event that the IO thread returns before starting the request.

Reviewed By: quark-zju

Differential Revision: D27584502

fbshipit-source-id: 8447c158d253c3f28f03fcc4c36a28698fe6e83d
2021-04-06 17:37:27 -07:00
..
async-runtime update tokio to 1.4.0 2021-03-31 10:44:20 -07:00
auth autocargo v1: changes to match autocargo v2 generation results. 2021-02-19 11:03:55 -08:00
backingstore eden/scm/lib: autogenerate all Cargo.toml files with autocargo 2021-03-05 04:29:49 -08:00
blackbox eden/scm/lib: autogenerate all Cargo.toml files with autocargo 2021-03-05 04:29:49 -08:00
bookmarkstore eden/scm/lib: autogenerate all Cargo.toml files with autocargo 2021-03-05 04:29:49 -08:00
checkout clone: make resumable checkout optional 2021-04-05 15:35:08 -07:00
clib Apply clang-format update fixes 2021-01-10 10:06:29 -08:00
clidispatch clidispatch: add --insecure global flag 2021-03-31 12:53:46 -07:00
cliparser third-party/rust: update tokio & tokio-stream 2021-03-10 11:01:28 -08:00
commitcloudsubscriber eden/scm/lib: autogenerate all Cargo.toml files with autocargo 2021-03-05 04:29:49 -08:00
configparser rust: update zstd crates to zstd 1.4.8 2021-04-01 06:20:12 -07:00
cpython-async update tokio to 1.4.0 2021-03-31 10:44:20 -07:00
cpython-ext eden/scm/lib: default to python3-sys 2021-03-23 01:13:08 -07:00
dag dag: fix path response with batch_size >= 2 2021-04-05 12:55:41 -07:00
dev-logger dag: add a test about sparse dag 2021-04-05 12:55:39 -07:00
drawdag autocargo v1: changes to match autocargo v2 generation results. 2021-02-19 11:03:55 -08:00
edenapi edenapi: re-export edenapi_types 2021-04-05 12:55:41 -07:00
edenfs-client eden/scm/lib: autogenerate all Cargo.toml files with autocargo 2021-03-05 04:29:49 -08:00
encoding eden/scm/lib: autogenerate all Cargo.toml files with autocargo 2021-03-05 04:29:49 -08:00
fsinfo eden/scm/lib: autogenerate all Cargo.toml files with autocargo 2021-03-05 04:29:49 -08:00
fsyncglob eden/scm/lib: autogenerate all Cargo.toml files with autocargo 2021-03-05 04:29:49 -08:00
hg-http hg-http: add support for --insecure flag 2021-03-31 12:53:46 -07:00
hg-metrics eden/scm/lib: autogenerate all Cargo.toml files with autocargo 2021-03-05 04:29:49 -08:00
hgcommands dag: make import_clone_data async 2021-04-05 12:55:38 -07:00
hgcommits streams: drop mut from resolve_remote 2021-04-05 12:51:37 -07:00
hgtime eden/scm/lib: autogenerate all Cargo.toml files with autocargo 2021-03-05 04:29:49 -08:00
http-client http-client: report setup errors for streaming requests 2021-04-06 17:37:27 -07:00
indexedlog indexedlog: add a way to set fsync globally 2021-03-30 09:56:46 -07:00
io pysptui: a tui using streampager 2021-03-31 07:59:26 -07:00
linelog Apply clang-format update fixes 2021-01-10 10:06:29 -08:00
lz4-pyframe autocargo v1: changes to match autocargo v2 generation results. 2021-02-19 11:03:55 -08:00
manifest eden/scm/lib: autogenerate all Cargo.toml files with autocargo 2021-03-05 04:29:49 -08:00
manifest-tree eden/scm/lib: autogenerate all Cargo.toml files with autocargo 2021-03-05 04:29:49 -08:00
metalog eden/scm/lib: autogenerate all Cargo.toml files with autocargo 2021-03-05 04:29:49 -08:00
mincode eden/scm/lib: autogenerate all Cargo.toml files with autocargo 2021-03-05 04:29:49 -08:00
minibench autocargo v1: changes to match autocargo v2 generation results. 2021-02-19 11:03:55 -08:00
minibytes minibytes: into_vec cannot use fast path if the vec is sliced 2021-03-10 17:16:53 -08:00
mpatch eden/scm/lib: autogenerate all Cargo.toml files with autocargo 2021-03-05 04:29:49 -08:00
mpatch-sys eden/scm/lib: autogenerate all Cargo.toml files with autocargo 2021-03-05 04:29:49 -08:00
mutationstore eden/scm/lib: autogenerate all Cargo.toml files with autocargo 2021-03-05 04:29:49 -08:00
nodemap eden/scm/lib: autogenerate all Cargo.toml files with autocargo 2021-03-05 04:29:49 -08:00
nonblocking third-party/rust: update futures 2021-03-04 06:42:55 -08:00
pathmatcher eden/scm/lib: autogenerate all Cargo.toml files with autocargo 2021-03-05 04:29:49 -08:00
procinfo eden/scm/lib: autogenerate all Cargo.toml files with autocargo 2021-03-05 04:29:49 -08:00
progress update tokio to 1.4.0 2021-03-31 10:44:20 -07:00
radixbuf eden/scm/lib: autogenerate all Cargo.toml files with autocargo 2021-03-05 04:29:49 -08:00
renderdag eden/scm/lib: autogenerate all Cargo.toml files with autocargo 2021-03-05 04:29:49 -08:00
revisionstore rust: update zstd crates to zstd 1.4.8 2021-04-01 06:20:12 -07:00
revlogindex dag: add APIs to test if Id or Vertex is present in IdMap locally 2021-04-05 12:51:38 -07:00
spawn-ext eden/scm/lib: autogenerate all Cargo.toml files with autocargo 2021-03-05 04:29:49 -08:00
streams streams: drop mut from resolve_remote 2021-04-05 12:51:37 -07:00
taggederror eden/scm/lib: autogenerate all Cargo.toml files with autocargo 2021-03-05 04:29:49 -08:00
taggederror-util eden/scm/lib: autogenerate all Cargo.toml files with autocargo 2021-03-05 04:29:49 -08:00
third-party mman-win32: remove 2020-10-02 10:47:24 -07:00
thrift-types thrift/rust: pass service_name and fn_name to call() on clients 2021-03-18 10:19:40 -07:00
tracing-analyzer autocargo v1: changes to how thrift-related generation is done to match v2 2021-02-23 11:38:45 -08:00
tracing-collector fix rust warnings 2021-03-22 11:47:55 -07:00
tracing-runtime-callsite tracing-runtime-callsite: fix a potential deadlock 2021-03-17 08:30:27 -07:00
treestate eden/scm/lib: autogenerate all Cargo.toml files with autocargo 2021-03-05 04:29:49 -08:00
types types: update HgId to use "bytes" serialization by default 2021-02-24 09:20:35 -08:00
util clidispatch: split dispatch() method 2021-03-12 11:39:09 -08:00
version configparser: fix non-fb dependencies (#45) 2020-08-26 16:31:00 -07:00
vfs update tokio to 1.4.0 2021-03-31 10:44:20 -07:00
vlqencoding autocargo v1: changes to match autocargo v2 generation results. 2021-02-19 11:03:55 -08:00
workingcopy eden/scm/lib: autogenerate all Cargo.toml files with autocargo 2021-03-05 04:29:49 -08:00
xdiff autocargo v2: rollout and replace v1 in all use-cases 2021-03-02 06:43:29 -08:00
xdiff-sys autocargo v2: rollout and replace v1 in all use-cases 2021-03-02 06:43:29 -08:00
zstdelta rust: update zstd crates to zstd 1.4.8 2021-04-01 06:20:12 -07:00
zstore autocargo v1: changes to how thrift-related generation is done to match v2 2021-02-23 11:38:45 -08:00
CMakeLists.txt clib: remove buffer.[ch] 2020-10-02 10:47:23 -07:00
README.md Move fb-mercurial sources into an eden/scm subdirectory. 2019-11-13 16:04:48 -08:00
run_cargo_tests.py config: use Rust graph render as default 2020-10-19 17:07:30 -07:00

lib

Any native code (C/C++/Rust) that Mercurial (either core or extensions) depends on should go here. Python code, or native code that depends on Python code (e.g. #include <Python.h> or use cpython) is disallowed.

As we start to convert more of Mercurial into Rust, and write new paths entrirely in native code, we'll want to limit our dependency on Python, which is why this barrier exists.

See also hgext/extlib/README.md, mercurial/cext/README.mb.

How do I choose between lib and extlib (and cext)?

If your code is native and doesn't depend on Python (awesome!), it goes here.

Otherwise, put it in hgext/extlib (if it's only used by extensions) or mercurial/cext (if it's used by extensions or core).