Re: New Version Notification for draft-kazuho-early-hints-status-code-00.txt

Cory Benfield <cory@lukasa.co.uk> Mon, 31 October 2016 18:27 UTC

Return-Path: <ietf-http-wg-request+bounce-httpbisa-archive-bis2juki=lists.ie@listhub.w3.org>
X-Original-To: ietfarch-httpbisa-archive-bis2Juki@ietfa.amsl.com
Delivered-To: ietfarch-httpbisa-archive-bis2Juki@ietfa.amsl.com
Received: from localhost (localhost [127.0.0.1]) by ietfa.amsl.com (Postfix) with ESMTP id 91B301299B9 for <ietfarch-httpbisa-archive-bis2Juki@ietfa.amsl.com>; Mon, 31 Oct 2016 11:27:21 -0700 (PDT)
X-Virus-Scanned: amavisd-new at amsl.com
X-Spam-Flag: NO
X-Spam-Score: -7.898
X-Spam-Level:
X-Spam-Status: No, score=-7.898 tagged_above=-999 required=5 tests=[BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, HEADER_FROM_DIFFERENT_DOMAINS=0.001, RCVD_IN_DNSWL_HI=-5, RCVD_IN_SORBS_SPAM=0.5, RP_MATCHES_RCVD=-1.497, SPF_HELO_PASS=-0.001, SPF_PASS=-0.001] autolearn=ham autolearn_force=no
Authentication-Results: ietfa.amsl.com (amavisd-new); dkim=pass (2048-bit key) header.d=lukasa-co-uk.20150623.gappssmtp.com
Received: from mail.ietf.org ([4.31.198.44]) by localhost (ietfa.amsl.com [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id RZnpYOIsXc7y for <ietfarch-httpbisa-archive-bis2Juki@ietfa.amsl.com>; Mon, 31 Oct 2016 11:27:20 -0700 (PDT)
Received: from frink.w3.org (frink.w3.org [128.30.52.56]) (using TLSv1.2 with cipher DHE-RSA-AES128-SHA (128/128 bits)) (No client certificate requested) by ietfa.amsl.com (Postfix) with ESMTPS id 3F9461299AF for <httpbisa-archive-bis2Juki@lists.ietf.org>; Mon, 31 Oct 2016 11:27:20 -0700 (PDT)
Received: from lists by frink.w3.org with local (Exim 4.80) (envelope-from <ietf-http-wg-request@listhub.w3.org>) id 1c1HE4-0006pY-Rf for ietf-http-wg-dist@listhub.w3.org; Mon, 31 Oct 2016 18:22:28 +0000
Resent-Date: Mon, 31 Oct 2016 18:22:28 +0000
Resent-Message-Id: <E1c1HE4-0006pY-Rf@frink.w3.org>
Received: from titan.w3.org ([128.30.52.76]) by frink.w3.org with esmtps (TLS1.2:RSA_AES_128_CBC_SHA1:128) (Exim 4.80) (envelope-from <cory@lukasa.co.uk>) id 1c1HE0-0006mi-02 for ietf-http-wg@listhub.w3.org; Mon, 31 Oct 2016 18:22:24 +0000
Received: from mail-wm0-f46.google.com ([74.125.82.46]) by titan.w3.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.84_2) (envelope-from <cory@lukasa.co.uk>) id 1c1HDt-0005jd-0n for ietf-http-wg@w3.org; Mon, 31 Oct 2016 18:22:18 +0000
Received: by mail-wm0-f46.google.com with SMTP id a197so36331377wmd.0 for <ietf-http-wg@w3.org>; Mon, 31 Oct 2016 11:21:56 -0700 (PDT)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=lukasa-co-uk.20150623.gappssmtp.com; s=20150623; h=mime-version:subject:from:in-reply-to:date:cc :content-transfer-encoding:message-id:references:to; bh=SYFJcozegjLLIDRLogMzxaJUmI+gc1gn61QpRkV/krE=; b=CMXSsWT7RxEM87oPwLhdFre3eeetUBbmTbBzdta1MOg89X/G8BA5oz2DELQ7xbEyBF giP3A6lX0K64P+N+EIKljVBxQcI4UHykRo2IlZnwWkDBfDklOSp4ZSAbHObm//UGLRFb CtqhaXvi6dUgzWzenny1lpwz79eprEzSbOG/deyd0iKpDdpfX1AKRCc4630oeaIIAPID pLqzfqAj0kQvLfmZ7qGBKlZ8SwxiwJ9LfZMsZWEi2+sbRL9NpNufoFZXdVIDbfxvZfLi tN0t7RH7fgCEOgyJf/sCUFWAdZ4bmoMj78KER6hCMzOIOqQkjqY2SfmR+twcIvqXJTv6 JBZQ==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:mime-version:subject:from:in-reply-to:date:cc :content-transfer-encoding:message-id:references:to; bh=SYFJcozegjLLIDRLogMzxaJUmI+gc1gn61QpRkV/krE=; b=LyLCKaLdAYwUG6vfCWOCpt62OzF24FBgH61uGjLG6PvRKMXL5rnm4jkJUs9kHO3vsx ZoifB+PM1q2teugbKed9vCUMnihyygKYclw5OONTWOlp5CD4YBzVuaK3T9o71KvX32Qy jQ9u3Lrk/o0uHkvgBHf5S1TGL8dzc2Z7KBhdaFD/qYb0Oa4+BvtPWRXhaG0cUcqQeXFn sd+1HtnOZ0l60Posup6OeuSAn3OQG4jOTllwmmsq7QJm+4RKOzGXbqmbketDXmoWZyHd r+Vd6xLYPvEy1Ak88Iz5Om/dmemeU6C+65GaGMEBFI8skgLS1PZPNoKHS/kh0toGZotQ ioWg==
X-Gm-Message-State: ABUngvfamdynlglNnr2vXoRUnGTv+yFvXXaN/H1TXy35ScwLqBEZIKEu5KH2AD2xklBI+g==
X-Received: by 10.28.68.195 with SMTP id r186mr6755903wma.105.1477938109586; Mon, 31 Oct 2016 11:21:49 -0700 (PDT)
Received: from [192.168.1.5] (72.6.208.46.dyn.plus.net. [46.208.6.72]) by smtp.gmail.com with ESMTPSA id g10sm4247907wjw.18.2016.10.31.11.21.48 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Mon, 31 Oct 2016 11:21:49 -0700 (PDT)
Content-Type: text/plain; charset="utf-8"
Mime-Version: 1.0 (Mac OS X Mail 10.1 \(3251\))
From: Cory Benfield <cory@lukasa.co.uk>
In-Reply-To: <CANatvzwm_T-HW0yT1MAWEUrfw5OAVkmAZe890575qg8HuU9Z_Q@mail.gmail.com>
Date: Mon, 31 Oct 2016 18:21:47 +0000
Cc: HTTP Working Group <ietf-http-wg@w3.org>
Content-Transfer-Encoding: quoted-printable
Message-Id: <86447165-100C-407D-8512-A32F93B11BBA@lukasa.co.uk>
References: <147792294052.32397.15544665152412530374.idtracker@ietfa.amsl.com> <CANatvzwm_T-HW0yT1MAWEUrfw5OAVkmAZe890575qg8HuU9Z_Q@mail.gmail.com>
To: Kazuho Oku <kazuhooku@gmail.com>
X-Mailer: Apple Mail (2.3251)
Received-SPF: pass client-ip=74.125.82.46; envelope-from=cory@lukasa.co.uk; helo=mail-wm0-f46.google.com
X-W3C-Hub-Spam-Status: No, score=-3.4
X-W3C-Hub-Spam-Report: BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, RCVD_IN_MSPIKE_H3=-0.01, RCVD_IN_MSPIKE_WL=-0.01, RCVD_IN_SORBS_SPAM=0.5, SPF_PASS=-0.001, W3C_AA=-1, W3C_WL=-1
X-W3C-Scan-Sig: titan.w3.org 1c1HDt-0005jd-0n bb7667d4c29893dd94c12c8f97707706
X-Original-To: ietf-http-wg@w3.org
Subject: Re: New Version Notification for draft-kazuho-early-hints-status-code-00.txt
Archived-At: <http://www.w3.org/mid/86447165-100C-407D-8512-A32F93B11BBA@lukasa.co.uk>
Resent-From: ietf-http-wg@w3.org
X-Mailing-List: <ietf-http-wg@w3.org> archive/latest/32758
X-Loop: ietf-http-wg@w3.org
Resent-Sender: ietf-http-wg-request@w3.org
Precedence: list
List-Id: <ietf-http-wg.w3.org>
List-Help: <http://www.w3.org/Mail/>
List-Post: <mailto:ietf-http-wg@w3.org>
List-Unsubscribe: <mailto:ietf-http-wg-request@w3.org?subject=unsubscribe>

> On 31 Oct 2016, at 14:25, Kazuho Oku <kazuhooku@gmail.com> wrote:
> 
> The draft proposes a new _informational_ status code that can be used
> for indicating hints to help a client start making preparations for
> processing the final response, while the server struggles to build the
> final response.
> 
> Actually, we already have a working implementation. H2O, our HTTP/2
> server, recognizes Link: rel=preload headers within an informational
> response sent from upstream, and tries to push the specified resource.
> One reason I decided to write this draft is because I believe it would
> be better to standardize the mechanism.

Kazuho,

This draft generally seems like a really good idea. It helps to resolve some of the substantial issues around the processing of large or high-latency responses, and as you have identified seems like it would make a good companion to HTTP/2 server push. I think this is a draft worth pursuing, and though I will not be at the next IETF meeting I look forward to seeing the progress through the IETF.

While I’m here, I’d like to discuss section 3. To provide some data points, most of the HTTP/1.1 clients in the Python ecosystem will not handle a new 1XX status code very well. A quick survey of the ecosystem suggests that the following tools will all misbehave:

- every standard library http client (urllib, urllib2, httplib), all of which treat only “100 Continue” specially: the rest will treat the 103 header block as the final response and, because it MUST NOT have a content-length, will read until connection close.
- every third-party library built on top of those tools, including urllib3, Requests, and httplib2, which inherit their misbehaviour.
- aiohttp, which special-cases 100 and 101 but not any others
- Twisted’s client, which special-cases 100

In fact, so far I haven’t found a single Python http client that would handle this response in any way that approaches sensible. I would even tolerating *ignoring* the response as a sensible behaviour, but we don’t even have that. In all cases, these clients treat the 103 response as the final response and totally lose track of their framing.

I doubt Python is unique here. While other languages may have libraries that are somewhat better at handling this situation, certainly some-to-many of them will continue to have this problem. This problem is also likely to be present throughout the long-tail of HTTP implementations: clearly it has been received wisdom by implementers that non-100 1XX status codes do not need to be supported because they will not be encountered. Worse, many of these implementations may be unable to update. Even if Python’s standard library http.client library was fixed to handle 1XX codes sensibly, the most widely-deployed version of Python (2.7) would not receive any such fix, meaning that all Python 2.7 users would be utterly confused by the receipt of a 103 status code.

This means that your suggestion that this should be negotiated is extremely important. I think it’s not “desirable” to negotiate this behaviour: I think it’ll have to be mandatory if we want to avoid screwing up a majority of long-tail HTTP/1.1 clients in the world. For HTTP/1.1, that’ll have to be negotiation by header, presumably by means of either an extension to the “Expect” header field or an equivalent header field that is inserted by analogy. For HTTP/2 this could be negotiated at the connection level by means of a settings value, or by the same header at the cost of one byte per request.

I’ll start filing bugs against relevant repositories to address this behaviour so that the Python ecosystem is less embarrassingly unprepared for further 1XX status codes, but in the short-to-medium term it would be much better if we could negotiate the 103 status code rather than assume it will function correctly.

Cory