Re: Stream State and PRIORITY Frames

Kazuho Oku <kazuhooku@gmail.com> Thu, 19 January 2017 03:00 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 6E55E12949F for <ietfarch-httpbisa-archive-bis2Juki@ietfa.amsl.com>; Wed, 18 Jan 2017 19:00:42 -0800 (PST)
X-Virus-Scanned: amavisd-new at amsl.com
X-Spam-Flag: NO
X-Spam-Score: -9.72
X-Spam-Level:
X-Spam-Status: No, score=-9.72 tagged_above=-999 required=5 tests=[BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, HEADER_FROM_DIFFERENT_DOMAINS=0.001, RCVD_IN_DNSWL_HI=-5, RCVD_IN_MSPIKE_H3=-0.01, RCVD_IN_MSPIKE_WL=-0.01, RCVD_IN_SORBS_SPAM=0.5, RP_MATCHES_RCVD=-3.199, 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=gmail.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 AHkcrPyTnaPJ for <ietfarch-httpbisa-archive-bis2Juki@ietfa.amsl.com>; Wed, 18 Jan 2017 19:00:40 -0800 (PST)
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 26D2B1294C1 for <httpbisa-archive-bis2Juki@lists.ietf.org>; Wed, 18 Jan 2017 19:00:39 -0800 (PST)
Received: from lists by frink.w3.org with local (Exim 4.80) (envelope-from <ietf-http-wg-request@listhub.w3.org>) id 1cU2v8-0006bO-EY for ietf-http-wg-dist@listhub.w3.org; Thu, 19 Jan 2017 02:57:50 +0000
Resent-Date: Thu, 19 Jan 2017 02:57:50 +0000
Resent-Message-Id: <E1cU2v8-0006bO-EY@frink.w3.org>
Received: from mimas.w3.org ([128.30.52.79]) by frink.w3.org with esmtps (TLS1.2:RSA_AES_128_CBC_SHA1:128) (Exim 4.80) (envelope-from <kazuhooku@gmail.com>) id 1cU2v5-0006ad-4F for ietf-http-wg@listhub.w3.org; Thu, 19 Jan 2017 02:57:47 +0000
Received: from mail-ot0-f174.google.com ([74.125.82.174]) by mimas.w3.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.84_2) (envelope-from <kazuhooku@gmail.com>) id 1cU2uy-00061c-TW for ietf-http-wg@w3.org; Thu, 19 Jan 2017 02:57:41 +0000
Received: by mail-ot0-f174.google.com with SMTP id 104so22876279otd.3 for <ietf-http-wg@w3.org>; Wed, 18 Jan 2017 18:57:20 -0800 (PST)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :cc:content-transfer-encoding; bh=iBVnuf5FbItR3VHSaS6UbHc22Zu1PaQJOviJ9XbQBSc=; b=GYuUwlntKb91KQOEpzacEUH8OSBEDzhnQ3ITeltECiq7Xxibc0jttmohkYsNVDtNVr 6FVGL/Bmzf2PXGFx5BXfi5ofoj3qBjM5CWznAzyrmG6Wx/498YO4c9ZnDvDd2p0+NbEQ vxwn+0Ex/N2Khcrs79ziOM6ws2eNfVU0UfbCqCR4+GmqaD7+QCi6YXXOsR9HipsB7IdM YYLajOZNZ5+sDEY4xgtoMYJaS2evwFP3IWTh25yjMAq1uefJzwWprKe9M0+LyccO5TzP nnVlSzPNulZAuqK2IJ0309sVmm41B6FQEcNh1Xc6qsUZr2qu0Uz/jfWFCQOmjdFcwiQo Yx4g==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:in-reply-to:references:from:date :message-id:subject:to:cc:content-transfer-encoding; bh=iBVnuf5FbItR3VHSaS6UbHc22Zu1PaQJOviJ9XbQBSc=; b=n6d/Tj5iRs8lgECLFulb+81r+KgSOZOmd92H6OtrM2YDUpiN+jNlDaMkChGnDnkzgA CVjk4tMfmFCUaNnYM6+ElT3QIFkED/KFm9f/IGr69bgQiACIxwwX5y+22MHREly/RKgj +genuoN7aSZSF1It8eBYXfPNKBjSExL77K8lfspTpepDrDkAfuGXj2jNZdda1BKyZyVm IQ8+kpHapcAp5R4kWVNr3BNY1AVqP8vODM1WRCiaa2B71TQtSiiHg4JZ3xkbZSmd/1Ip 8yQrZ7ejTetK5zJ4EY+YqAaei3pFCUqfORmLQN6rpLntuIU3WJ2Mh10XnymAj04I5OBq jM/g==
X-Gm-Message-State: AIkVDXL/6nHptTnbp6EPUBNzixiaqgTZX0BfkDcioR+C0JM/llHITuqX1m0IKzulJNYqkE4evG6BQql909V0gg==
X-Received: by 10.157.45.84 with SMTP id v78mr3036861ota.102.1484794634380; Wed, 18 Jan 2017 18:57:14 -0800 (PST)
MIME-Version: 1.0
Received: by 10.157.16.113 with HTTP; Wed, 18 Jan 2017 18:57:13 -0800 (PST)
In-Reply-To: <CAFn2buAE-EdTEG9x-wLQSy5Osmcq1Hdps9YLW_7j9CTV4_Fuyw@mail.gmail.com>
References: <CAFn2buAYWHQSWhhoKZ2GKbqXR1A+tScjkAwZmOuQ9gV9jMp2bA@mail.gmail.com> <CAGZNdJWe0Y=M_SWmgYabKbWZwPEuJdw67Km8+UtR4oUtZuXA5A@mail.gmail.com> <2BC01E49-91A1-43A7-AFD0-5A34F2689428@lukasa.co.uk> <CAFn2buDCMwMp=rR0C_yt4-gUwyFhY6ruonz9wT-jVMu+Kir=nA@mail.gmail.com> <C51C3F51-37BE-489F-BA1D-76B101517307@lukasa.co.uk> <CAFn2buAE-EdTEG9x-wLQSy5Osmcq1Hdps9YLW_7j9CTV4_Fuyw@mail.gmail.com>
From: Kazuho Oku <kazuhooku@gmail.com>
Date: Thu, 19 Jan 2017 11:57:13 +0900
Message-ID: <CANatvzzEV6Qd1huVxO=T2m7UwwX207RCetrXyZ1FMMGrBtzeEg@mail.gmail.com>
To: Scott Mitchell <scott.k.mitch1@gmail.com>
Cc: Cory Benfield <cory@lukasa.co.uk>, Benedikt Christoph Wolters <benedikt.wolters@rwth-aachen.de>, HTTP Working Group <ietf-http-wg@w3.org>
Content-Type: text/plain; charset="UTF-8"
Content-Transfer-Encoding: quoted-printable
Received-SPF: pass client-ip=74.125.82.174; envelope-from=kazuhooku@gmail.com; helo=mail-ot0-f174.google.com
X-W3C-Hub-Spam-Status: No, score=-4.3
X-W3C-Hub-Spam-Report: AWL=-0.786, BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, FREEMAIL_FROM=0.001, 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: mimas.w3.org 1cU2uy-00061c-TW 0f11de0885941138d2f407a9cdf4cd5e
X-Original-To: ietf-http-wg@w3.org
Subject: Re: Stream State and PRIORITY Frames
Archived-At: <http://www.w3.org/mid/CANatvzzEV6Qd1huVxO=T2m7UwwX207RCetrXyZ1FMMGrBtzeEg@mail.gmail.com>
Resent-From: ietf-http-wg@w3.org
X-Mailing-List: <ietf-http-wg@w3.org> archive/latest/33321
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>

2017-01-19 9:53 GMT+09:00 Scott Mitchell <scott.k.mitch1@gmail.com>:
>
>
> On Wed, Jan 18, 2017 at 11:50 AM, Cory Benfield <cory@lukasa.co.uk> wrote:
>>
>>
>> On 18 Jan 2017, at 16:38, Scott Mitchell <scott.k.mitch1@gmail.com> wrote:
>>
>> This is interesting. If FF is using streams 1-7 then as soon as stream 9
>> is used for a HEADERS request that will close streams 1-7 according to
>> section 5.1.1:
>>
>> > first use of a new stream identifier implicitly closes all streams in
>> > the "idle" state that might have been initiated by that peer with a
>> > lower-valued stream identifier
>>
>>
>> Only if they are not opened via HEADERS frames, which they are. FF sent (I
>> haven’t checked recently) PRIORITY frames for the first few stream IDs, and
>> then started sending HEADERS from 1 onwards.
>>
>>
>
>
> I just ran FF 50.1.0 against a simple local server (TLS+ALPN) and here is
> the behavior I observe:
>
> 1. Client PRIORITY [StreamId=3,StreamDependency=0,
> Weight=201,Exclusive=False] -> Server
> 2. Client PRIORITY [StreamId=5,StreamDependency=0,
> Weight=101,Exclusive=False] -> Server
> 3. Client PRIORITY [StreamId=7,StreamDependency=0, Weight=1,Exclusive=False]
> -> Server
> 4. Client PRIORITY [StreamId=9,StreamDependency=7, Weight=1,Exclusive=False]
> -> Server
> 5. Client PRIORITY [StreamId=11,StreamDependency=3,
> Weight=1,Exclusive=False] -> Server
> 6. Client HEADERS [StreamId=13,StreamDependency=11,
> Weight=2,Exclusive=False] -> Server (a GET "/" request)
> 7. Client HEADERS [StreamId=15,StreamDependency=0,
> Weight=16,Exclusive=False] -> Server (a GET "/favicon.ico" request)
>
> There were other frames (SETTINGS, DATA, PING, WINDOW_UPDATE, GO_AWAY) which
> were omitted for the purposes of this discussion.
>
> Based on the RFC it seems like stream ids {3, 5, 7, 11} should be closed at
> step (6).

I had the same discussion with Cory, and now I agree with him that we
should _not_ interpret the specification that way.

As Cory points out on
https://github.com/h2o/h2o/pull/1136#issuecomment-266213322, the
normative definition is

   The identifier of a newly established stream MUST be numerically
   greater than all streams that the initiating endpoint has opened or
   reserved. This governs streams that are opened using a HEADERS frame
   and streams that are reserved using PUSH_PROMISE.

Therefore, a PRIORITY frame does not implicitly close the streams with
smaller IDs.

The following text that discusses when a stream gets implicitly closed
is written immediately after the formal description show above, so it
is fair to assume that the word _use_ in the sentence means when the
stream is opened or reserved (and not when a PRIORITY frame is
received).

   The first use of a new stream identifier implicitly closes all
   streams in the "idle" state that might have been initiated by that
   peer with a lower-valued stream identifier.


> Note that FF is not doing anything wrong here. It shouldn't have
> to care that the streams are CLOSED in this scenario (assuming these streams
> only ever have PRIORITY frames exchanged). It would be interesting to get a
> FF dev to comment on the expected stream state here just to be sure these
> streams will only be used for PRIORITY. Either way maintaining/interpreting
> the priority is at the discretion of the server and these streams being
> closed does not impact the server's ability to do this (as discussed
> previously the RFC suggests retaining priority for closed streams).
>
>
>> Cory
>>
>



-- 
Kazuho Oku