Re: Push Promise Issues

James M Snell <> Wed, 24 April 2013 18:33 UTC

Return-Path: <>
Received: from localhost (localhost []) by (Postfix) with ESMTP id 13F2821F8B9C for <>; Wed, 24 Apr 2013 11:33:28 -0700 (PDT)
X-Virus-Scanned: amavisd-new at
X-Spam-Flag: NO
X-Spam-Score: -10.377
X-Spam-Status: No, score=-10.377 tagged_above=-999 required=5 tests=[AWL=-0.078, BAYES_00=-2.599, MIME_8BIT_HEADER=0.3, RCVD_IN_DNSWL_HI=-8]
Received: from ([]) by localhost ( []) (amavisd-new, port 10024) with ESMTP id mohRwsYAfT7y for <>; Wed, 24 Apr 2013 11:33:27 -0700 (PDT)
Received: from ( []) by (Postfix) with ESMTP id 0BB7721F896E for <>; Wed, 24 Apr 2013 11:33:27 -0700 (PDT)
Received: from lists by with local (Exim 4.72) (envelope-from <>) id 1UV4Ul-0000VB-OT for; Wed, 24 Apr 2013 18:32:43 +0000
Resent-Date: Wed, 24 Apr 2013 18:32:43 +0000
Resent-Message-Id: <>
Received: from ([]) by with esmtp (Exim 4.72) (envelope-from <>) id 1UV4Ug-0000Tj-LD for; Wed, 24 Apr 2013 18:32:38 +0000
Received: from ([]) by with esmtps (TLS1.0:RSA_ARCFOUR_SHA1:16) (Exim 4.72) (envelope-from <>) id 1UV4Uf-000855-Hb for; Wed, 24 Apr 2013 18:32:38 +0000
Received: by with SMTP id i10so2060193oag.15 for <>; Wed, 24 Apr 2013 11:32:11 -0700 (PDT)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;; s=20120113; h=x-received:mime-version:in-reply-to:references:from:date:message-id :subject:to:cc:content-type:content-transfer-encoding; bh=izRJS5ICsDvOeJ13Dv8hATEBQ2DmpFsx9iHlH/ME8Eg=; b=Ctbs8vejQj1wfROzzXRKBlbADUC9vXc9EGkssKVNsYsBBf+d9TElwanLoBuXoIJo8J LOw0m/6Mb9nk4R8D5YFKr1YDG6ZeoKOlQ/NQe3sxS/yMgjV1pHNfSXrHEvK0qP5F3MHE WWm0tH1ZMqF4R1yDerds2BCYmvr+sFSTYxeoNBoAKAqAvsk+MG+MhsUZuKe+fC3xpc2z Gw+uVe9TGz3DzTBjMxzV4atLkAQC3Sk9dm4Sx/gN6WpYK1vOMhL3FVvXHPOD456Lcqkx gFogECnx0bO3+YG2082MnlXOYIP4IlPmgOHEajlRTC6GMi9sOuFwpcV5CwpONcjaPJTW SnSg==
X-Received: by with SMTP id d5mr4354297obf.43.1366828331484; Wed, 24 Apr 2013 11:32:11 -0700 (PDT)
MIME-Version: 1.0
Received: by with HTTP; Wed, 24 Apr 2013 11:31:51 -0700 (PDT)
In-Reply-To: <>
References: <> <>
From: James M Snell <>
Date: Wed, 24 Apr 2013 11:31:51 -0700
Message-ID: <>
To: =?UTF-8?B?V2lsbGlhbSBDaGFuICjpmYjmmbrmmIwp?= <>
Cc: "" <>
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: quoted-printable
Received-SPF: pass client-ip=;;
X-W3C-Hub-Spam-Status: No, score=-3.5
X-W3C-Hub-Spam-Report: AWL=-2.681, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, FREEMAIL_FROM=0.001, RCVD_IN_DNSWL_LOW=-0.7, SPF_PASS=-0.001
X-W3C-Scan-Sig: 1UV4Uf-000855-Hb 53fefb1d15a7f0688e02beb40b68f742
Subject: Re: Push Promise Issues
Archived-At: <>
X-Mailing-List: <> archive/latest/17553
Precedence: list
List-Id: <>
List-Help: <>
List-Post: <>
List-Unsubscribe: <>

On Wed, Apr 24, 2013 at 10:25 AM, William Chan (陈智昌)
<> wrote:
> I didn't comment on any editorial stuff because I suck at it, but fwiw I
> agree with your points on all the areas that can/should be clarified.
> On Wed, Apr 24, 2013 at 9:35 AM, James M Snell <> wrote:
>> 2. If the client is rejecting the promised stream, the error code used
>> in the RST_STREAM ought to be REFUSED_STREAM and not CANCEL.
> Can you explain why? It's not clear to me how a server would handle them
> differently. I do see that the client may be able to indicate that it has
> not processed the stream at all, but I'm not sure that matters. On the other
> hand, I think it's useful in the opposite direction to use REFUSED_STREAM to
> indicate that it's safe for the client to retry the request. I think there's
> an editorial issue to clarify that in the spec
> (

The main reason is that there is a difference between a client no
longer needing a pushed stream vs. not wanting it at all. For
instance, if the client navigates away from a page, the stream being
pushed is CANCELed. If the client returns back to that page later,
then the server will likely attempt to push the resource again. If,
however, the client refuses a pushed stream because the pushed
resource is unacceptable in some manner, then the server might choose
to not attempt pushing the resource again later on (obviously there
are quite a few assumptions about managed state being made in that
example). The bottom line is that I do not think we should make too
many assumptions about how a server will handle the difference between
the two cases.

>> 3. How long should a client wait for the transmission of a promised
>> stream? Is there some reasonable timeout? Should the client simply
>> issue a CANCEL if it feels the stream hasn't been received in a
>> reasonable period of time? If so, that needs to be described.
> I'm not sure this is any different from how long a client would wait for a
> SYN_REPLY (oops, I mean the HEADERS frame). My client (Chromium) will not
> time out, but that's up to the client. Typically users will reload the page
> which will trigger cancellations and resending of a HEADERS+PRIORITY frame.
> We may also use PING frames for liveness detection, but that would lead us
> to terminate the entire session.

I tend to agree, but it needs to be stated explicitly if this is the
case. Some simple statement along the lines of: A client can send a
CANCEL if the server takes too long to send a promised stream... etc

>> 7. Whether or not a client can send a PUSH_PROMISE to the server needs
>> to be determined. One can easily envision a use case where a client
>> wishes to send multiple simultaneous streams to a server. For
>> instance, sending a PUT or POST to a server that has multiple payloads
>> (uploading more than one picture or video at a time, for instance).
>> While such a use case is not currently covered by HTTP/1 semantics,
>> the new framing layer makes such cases possible and we need to decide
>> now whether or not we are going to allow it.
>> For example,
>> A. Client creates a stream to the server with :method=POST, includes
>> two PUSH_PROMISE frames for two images it wishes to upload...
>> B. Client sends each image in separate streams with their own HEADERS
>> frame.
> I'm sleep deprived and still confused this morning, but I don't grok this
> one. Can you explain why a client would send a PUSH_PROMISE rather than a
> SYN_STREAM (er, a HEADERS+PRIORITY, god my brain still needs to wrap around
> these new names) frame? PUSH_PROMISE exists to prevent races (having the
> peer request the resource at the same time that the sender is trying to push
> it). I don't see how the race exists in the client=>server direction with
> HTTP semantics, although I can imagine a non-HTTP semantic layering atop the
> framing layer that might have this race.

The idea is simply sending multiple request payloads with a single
http operation.. a POST with N-number individual associated streams,
for instance. Uploading photos is one use case, adding items to an
Atom Publishing Collection is another. Right now much of this is done
using clunky multipart mime formats. It could be done more efficiently
with multiplexed streams.

- James

>> Another case, dealing with the age-old problem of uploading a media
>> resource and it's associated metadata in a single operation (currently
>> implemented in many apis as a clumsy MIME package):
>> A. Client creates a stream to the server with :method=PUT, includes
>> two PUSH_PROMISE frames, one for the image, the other for metadata
>> about the image.
>> B. Client sends each part in separate streams with their own HEADERS
>> frame.
>> In my opinion, these are very compelling use cases that need to be
>> carefully considered. If clients are allowed to send PUSH_PROMISE
>> frames, we need to mention it.
>> Possibly more later...
>> - James