[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Bug#810796: HTTP pipelining is broken and causes download failures



On 12 January 2016 at 12:57, Robie Basak <robie.basak@ubuntu.com> wrote:
> Package: apt
> Version: 1.10
> User: ubuntu-devel@lists.ubuntu.com
> Usertags: origin-ubuntu xenial
>
> apt enables pipelining by default. But it does not check to see if the
> server supports HTTP/1.1, so where the server doesn't apt is breaking
> the HTTP protocol by attempting to use pipelining. This causes download
> failures.
>
> Workaround: "Acquire::http::Pipeline-Depth 0;" makes it work. It might
> be an idea to drop the pipelining default until this is fixed.
>
> In my case, I have http://ftp.debian.org/debian in my sources.list, but
> go through a squid 2.7.STABLE7 proxy as the machine running apt doesn't
> have direct access to the Internet. This is done explicitly using a
> Acquire::HTTP::Proxy setting (so not using transparent interception).
>
> I'm getting "Hash Sum mismatch" errors on some downloaded debs. Right
> now I get this failure if I have a sid chroot created by "mk-sbuild"
> (from ubuntu-dev-tools) and attempt to "apt-get build-dep mysql-5.6"
> through my proxy. I'm not sure how reproducible this might be for
> others, but I can reproduce it reliably right now. Unfortunately
> behaviour might also change as sid changes.
>
> I captured apt's traffic to my proxy. and in the failure case I see it
> requesting pipelined files immediately, which I think is wrong of apt,
> followed by HTTP/1.0 "Connection: close" responses from the proxy (which
> is why I think it is wrong of apt, since it should only request
> pipelining with HTTP/1.1 servers).

Well, yes, nobody really uses HTTP/1.0 servers, so it's not really tested much.

If we have hashes, we will try to do pipelining and then fall back if
the server messes up the response.

Maybe it helps to also disable pipelining if the server responds with
HTTP/1.0, like this:

diff --git a/methods/server.cc b/methods/server.cc
index d5188d4..a64bf0f 100644
--- a/methods/server.cc
+++ b/methods/server.cc
@@ -150,9 +150,14 @@ bool ServerState::HeaderLine(string Line)
       else
       {
         if (Major == 1 && Minor == 0)
+        {
            Persistent = false;
+           Pipeline = false;
+        }
         else
+        {
            Persistent = true;
+        }
       }

       return true;


Not sure though

-- 
Julian Andres Klode  - Debian Developer, Ubuntu Member

See http://wiki.debian.org/JulianAndresKlode and http://jak-linux.org/.


Reply to: