-
Notifications
You must be signed in to change notification settings - Fork 2.4k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
fix: disable multiplexing for some versions of curl #12234
Conversation
r? @ehuss (rustbot has picked a reviewer for you, use r? to override) |
BTW. Although this is not really a regression, with sparse registry the number of connections is easier to exceed |
src/cargo/util/config/mod.rs
Outdated
#[cfg(target_os = "macos")] | ||
{ | ||
// We only take care of macOS now, since it is one of the major | ||
// platforms. For other OS we encourage not to stick to older | ||
// versions of libcurl. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm a little uncertain about making this macos only. What would be the concern with just checking this on all platforms?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
That was just me trying to shave off all old system libcurl aggressively 😅.
The constraint has been removed.
And weird. I forced pushed something but it didn't show up in this pull request.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There's an ongoing incident: https://www.githubstatus.com/incidents/1g1gkh0qpyvs
644083d
to
62bd959
Compare
If you want to backport this to beta, that sounds good to me! I think at some point it would be good to set up a proxy test using the container tests. |
In certain versions of libcurl when proxy is in use with HTTP/2 multiplexing, connections will continue stacking up. This was fixed in libcurl 8.0.0 in curl/curl@821f6e2 However, Cargo can still link against old system libcurl if it is from a custom built one or on macOS. For those cases, multiplexing needs to be disabled when those versions are detected.
Thanks for the review! @bors r=ehuss
Was thinking the same thing, though it feels a bit too hard to write one. I'll try when I have time. Thanks for the suggestion! |
☀️ Test successful - checks-actions |
fix: disable multiplexing on macOS for some versions of curl
fix: disable multiplexing for some versions of curl
…nglo [beta-1.71] cargo backport 1 commits in 64fb38c97ac4d3a327fc9032c862dd28c8833b17..cfd3bbd8fe4fd92074dfad04b7eb9a923646839f 2023-05-23 18:53:23 +0000 to 2023-06-08 08:44:47 +0000 - [beta-1.70] backport rust-lang/cargo#12234 (rust-lang/cargo#12242) r? `@ghost`
Update cargo 12 commits in b0fa79679e717cd077b7fc0fa4166f47107f1ba9..49b6d9e179a91cf7645142541c9563443f64bf2b 2023-06-03 14:19:48 +0000 to 2023-06-09 17:21:19 +0000 - docs: doc comments for all registry kinds (rust-lang/cargo#12247) - chore: Migrate print-ban from test to clippy (rust-lang/cargo#12246) - fix: fetch nested git submodules (rust-lang/cargo#12244) - refactor: registry source cleanup (rust-lang/cargo#12240) - test: loose overly matches for git cli output (rust-lang/cargo#12241) - fix: disable multiplexing on macOS for some versions of curl (rust-lang/cargo#12234) - docs: doc comments for registry source and index (rust-lang/cargo#12239) - doc: point to nightly cargo doc (rust-lang/cargo#12237) - Upgrade to `gix` v0.45 for multi-round pack negotiations. (rust-lang/cargo#12236) - refactor: git source cleanup (rust-lang/cargo#12197) - Add message on reusing previous temporary path on failed cargo installs (rust-lang/cargo#12231) - doc: the first line should be a simple sentence instead of a heading (rust-lang/cargo#12228) r? `@ghost`
I'm behind a corporate proxy and was hitting a `Curl 2 (...) [CONN-1-0] send: no filter connected` error when trying to download some packages. Some google research led me to rust-lang/cargo#12202 and its fix rust-lang/cargo#12234. This PR backports this fix to composer. > In certain versions of libcurl when proxy is in use with HTTP/2 multiplexing, connections will continue stacking up. This was fixed in libcurl 8.0.0 in curl/curl@821f6e2
I'm behind a corporate proxy and was hitting a `Curl 2 (...) [CONN-1-0] send: no filter connected` error when trying to download some packages. Some google research led me to rust-lang/cargo#12202 and its fix rust-lang/cargo#12234. This PR backports this fix to composer. > In certain versions of libcurl when proxy is in use with HTTP/2 multiplexing, connections will continue stacking up. This was fixed in libcurl 8.0.0 in curl/curl@821f6e2
* disable multiplexing for some versions of curl I'm behind a corporate proxy and was hitting a `Curl 2 (...) [CONN-1-0] send: no filter connected` error when trying to download some packages. Some google research led me to rust-lang/cargo#12202 and its fix rust-lang/cargo#12234. This PR backports this fix to composer. > In certain versions of libcurl when proxy is in use with HTTP/2 multiplexing, connections will continue stacking up. This was fixed in libcurl 8.0.0 in curl/curl@821f6e2 * fix has proxy condition
What does this PR try to resolve?
Fixes #12202.
Zulip topic.
In certain versions of libcurl when proxy is in use with HTTP/2
multiplexing, connections will continue stacking up. This was
fixed in libcurl 8.0.0 in curl/curl@821f6e2
However, Cargo can still link against old system libcurl if it is from a
custom built one or on macOS. For those cases, multiplexing needs to be
disabled when those versions are detected.
How should we test and review this PR?
The first commit refactors how Cargo gets
http.proxy
config, so thatwecan have the detection inside
Config
. Please call it out if youfeel uncomfortable to this.
The second one did the trick, and a unit test is added.
Manual test the behavior
To manually test the behavior, you need to build cargo with
the
all-static
feature, which despite its name links libcurldynamically on macOS. It is a feature used by rustup distributions.
I don't really understand curl internals so had no luck to figure
out the relationship between proxies and HTTP/2 multiplexing.
I use
hinata/nginx-forward-proxy
to spin up a proxy to test curl's behavior.It turns out that if there are fewer dependencies to download,
or we set
MAX_CONCURRENT_STREAMS
to a lower value in curl,it largely affects the happening of the error
no filter connected
.That implies multiplexing and http proxy are really influencing
each other in some way.
My patch to curl and curl-sys