Skip to content
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

pacman downloads sometimes stall after upgrading to curl 7.79.0 #7730

Closed
foutrelis opened this issue Sep 16, 2021 · 3 comments
Closed

pacman downloads sometimes stall after upgrading to curl 7.79.0 #7730

foutrelis opened this issue Sep 16, 2021 · 3 comments
Assignees
Labels

Comments

@foutrelis
Copy link

After upgrading to curl 7.79.0 (from 7.78.0) I'm seeing connection stalls and dropouts in Arch Linux's package manager (pacman). The issue is reproducible when using Basic authentication against a HTTP/2 mirror. (It doesn't happen without Basic auth.)

Bisected this to commit 3cb8a74. I don't have a reliable reproducer yet; I used repeated pacman -Syy calls for testing and the issue usually occurs within the first few invocations. Each pacman -Syy call downloads 5 repositories concurrently (a few MiB each) using libcurl's multi interface.

No tangible error messages other than Operation too slow. Less than 1 bytes/sec transferred the last 10 seconds and/or transfer closed with 5472421 bytes remaining to read. Sorry for not providing a reproducer outside of pacman; I'll update this issue if I manage to come up with one.

curl/libcurl version

curl 7.79.0 (x86_64-pc-linux-gnu) libcurl/7.79.0 OpenSSL/1.1.1l zlib/1.2.11 brotli/1.0.9 zstd/1.5.0 libidn2/2.3.2 libpsl/0.21.1 (+libidn2/2.3.0) libssh2/1.9.0 nghttp2/1.44.0
Release-Date: 2021-09-15
Protocols: dict file ftp ftps gopher gophers http https imap imaps mqtt pop3 pop3s rtsp scp sftp smb smbs smtp smtps telnet tftp 
Features: alt-svc AsynchDNS brotli GSS-API HSTS HTTP2 HTTPS-proxy IDN IPv6 Kerberos Largefile libz NTLM NTLM_WB PSL SPNEGO SSL TLS-SRP UnixSockets zstd

operating system

Arch Linux x86_64

Linux notbad 5.14.3-arch1-1 #1 SMP PREEMPT Sun, 12 Sep 2021 20:51:34 +0000 x86_64 GNU/Linux

@bagder bagder added the HTTP/2 label Sep 16, 2021
@bagder
Copy link
Member

bagder commented Sep 16, 2021

Can you try a patch? I immediately now spotted a mistake in that commit.

diff --git a/lib/http2.c b/lib/http2.c
index a3de607c7..6d63f4363 100644
--- a/lib/http2.c
+++ b/lib/http2.c
@@ -2219,16 +2219,10 @@ CURLcode Curl_http2_setup(struct Curl_easy *data,
   stream->upload_mem = NULL;
   stream->upload_len = 0;
   stream->mem = data->state.buffer;
   stream->len = data->set.buffer_size;
 
-  httpc->inbuflen = 0;
-  httpc->nread_inbuf = 0;
-
-  httpc->pause_stream_id = 0;
-  httpc->drain_total = 0;
-
   multi_connchanged(data->multi);
   /* below this point only connection related inits are done, which only needs
      to be done once per connection */
 
   if((conn->handler == &Curl_handler_http2_ssl) ||
@@ -2250,10 +2244,16 @@ CURLcode Curl_http2_setup(struct Curl_easy *data,
 
   conn->bits.multiplex = TRUE; /* at least potentially multiplexed */
   conn->httpversion = 20;
   conn->bundle->multiuse = BUNDLE_MULTIPLEX;
 
+  httpc->inbuflen = 0;
+  httpc->nread_inbuf = 0;
+
+  httpc->pause_stream_id = 0;
+  httpc->drain_total = 0;
+
   infof(data, "Connection state changed (HTTP/2 confirmed)");
 
   return CURLE_OK;
 }
 

bagder added a commit that referenced this issue Sep 16, 2021
Regression from 3cb8a74 (releasde in 7.79.0). That change moved
transfer oriented inits to before the check but also erroneously moved a
few connection oriented ones, which causes problems.

Fixes #7730
Reported-by: Evangelos Foutras
@bagder bagder self-assigned this Sep 16, 2021
@foutrelis
Copy link
Author

Seems to have fixed it! I have pacman -Syy running in a loop for a few minutes now with no issues (whereas previously it would fail within seconds).

Many thanks!

@bagder
Copy link
Member

bagder commented Sep 16, 2021

Primarily due to this issue, we now plan a 7.79.1 patch release for Sep 22.

@bagder bagder closed this as completed in 901804e Sep 16, 2021
archlinux-github pushed a commit to archlinux/svntogit-packages that referenced this issue Sep 16, 2021
curl/curl#7730


git-svn-id: file:///srv/repos/svn-packages/svn@424094 eb2447ed-0c53-47e4-bac8-5bc4a241df78
archlinux-github pushed a commit to archlinux/svntogit-packages that referenced this issue Sep 16, 2021
curl/curl#7730

git-svn-id: file:///srv/repos/svn-packages/svn@424094 eb2447ed-0c53-47e4-bac8-5bc4a241df78
@jay jay pinned this issue Sep 17, 2021
@bagder bagder unpinned this issue Sep 22, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Development

Successfully merging a pull request may close this issue.

2 participants