Re: Stream State and PRIORITY Frames

Benedikt Christoph Wolters <benedikt.wolters@rwth-aachen.de> Tue, 17 January 2017 08:43 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 3275A129412 for <ietfarch-httpbisa-archive-bis2Juki@ietfa.amsl.com>; Tue, 17 Jan 2017 00:43:20 -0800 (PST)
X-Virus-Scanned: amavisd-new at amsl.com
X-Spam-Flag: NO
X-Spam-Score: -9.62
X-Spam-Level:
X-Spam-Status: No, score=-9.62 tagged_above=-999 required=5 tests=[BAYES_00=-1.9, 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
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 5rwDvqzNdgUc for <ietfarch-httpbisa-archive-bis2Juki@ietfa.amsl.com>; Tue, 17 Jan 2017 00:43:14 -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 84EC3129407 for <httpbisa-archive-bis2Juki@lists.ietf.org>; Tue, 17 Jan 2017 00:43:14 -0800 (PST)
Received: from lists by frink.w3.org with local (Exim 4.80) (envelope-from <ietf-http-wg-request@listhub.w3.org>) id 1cTPIy-00079B-PJ for ietf-http-wg-dist@listhub.w3.org; Tue, 17 Jan 2017 08:39:48 +0000
Resent-Date: Tue, 17 Jan 2017 08:39:48 +0000
Resent-Message-Id: <E1cTPIy-00079B-PJ@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 <benedikt.wolters@rwth-aachen.de>) id 1cTPIu-00078C-RR for ietf-http-wg@listhub.w3.org; Tue, 17 Jan 2017 08:39:44 +0000
Received: from mx-out-1.rwth-aachen.de ([134.130.5.186]) by mimas.w3.org with esmtps (TLS1.0:DHE_RSA_CAMELLIA_256_CBC_SHA1:256) (Exim 4.84_2) (envelope-from <benedikt.wolters@rwth-aachen.de>) id 1cTPIo-0000el-He for ietf-http-wg@w3.org; Tue, 17 Jan 2017 08:39:39 +0000
X-IronPort-AV: E=Sophos;i="5.33,243,1477954800"; d="scan'208";a="569881825"
Received: from rwthex-s1-a.rwth-ad.de ([134.130.26.152]) by mx-1.rz.rwth-aachen.de with ESMTP; 17 Jan 2017 09:39:16 +0100
Received: from mail-qt0-f170.google.com (209.85.216.170) by rwthex-s1-a.rwth-ad.de (2002:8682:1a98::8682:1a98) with Microsoft SMTP Server (TLS) id 15.0.1236.3; Tue, 17 Jan 2017 09:39:15 +0100
Received: by mail-qt0-f170.google.com with SMTP id v23so144402772qtb.0 for <ietf-http-wg@w3.org>; Tue, 17 Jan 2017 00:39:15 -0800 (PST)
X-Gm-Message-State: AIkVDXIuyXXVTKVXLmtatfhTx4GXoa+YdSb9gxooQKI/TH8VkBjDDzrlGQkOgLh10ySsXsGL5xblVqmzQrWTRQ==
X-Received: by 10.55.177.65 with SMTP id a62mr37919437qkf.215.1484642354588; Tue, 17 Jan 2017 00:39:14 -0800 (PST)
MIME-Version: 1.0
Received: by 10.12.182.130 with HTTP; Tue, 17 Jan 2017 00:38:44 -0800 (PST)
In-Reply-To: <CAFn2buAYWHQSWhhoKZ2GKbqXR1A+tScjkAwZmOuQ9gV9jMp2bA@mail.gmail.com>
References: <CAFn2buAYWHQSWhhoKZ2GKbqXR1A+tScjkAwZmOuQ9gV9jMp2bA@mail.gmail.com>
From: Benedikt Christoph Wolters <benedikt.wolters@rwth-aachen.de>
Date: Tue, 17 Jan 2017 09:38:44 +0100
X-Gmail-Original-Message-ID: <CAGZNdJWe0Y=M_SWmgYabKbWZwPEuJdw67Km8+UtR4oUtZuXA5A@mail.gmail.com>
Message-ID: <CAGZNdJWe0Y=M_SWmgYabKbWZwPEuJdw67Km8+UtR4oUtZuXA5A@mail.gmail.com>
To: Scott Mitchell <scott.k.mitch1@gmail.com>
CC: HTTP Working Group <ietf-http-wg@w3.org>
Content-Type: text/plain; charset="UTF-8"
X-Originating-IP: [209.85.216.170]
X-ClientProxiedBy: rwthex-s1-a.rwth-ad.de (2002:8682:1a98::8682:1a98) To rwthex-s1-a.rwth-ad.de (2002:8682:1a98::8682:1a98)
Received-SPF: none client-ip=134.130.5.186; envelope-from=benedikt.wolters@rwth-aachen.de; helo=mx-out-1.rwth-aachen.de
X-W3C-Hub-Spam-Status: No, score=-8.9
X-W3C-Hub-Spam-Report: BAYES_00=-1.9, RCVD_IN_DNSWL_MED=-2.3, RCVD_IN_SORBS_SPAM=0.5, RP_MATCHES_RCVD=-3.199, W3C_AA=-1, W3C_WL=-1
X-W3C-Scan-Sig: mimas.w3.org 1cTPIo-0000el-He 663d1eb3c10d2ee044a4de0c565bf8c9
X-Original-To: ietf-http-wg@w3.org
Subject: Re: Stream State and PRIORITY Frames
Archived-At: <http://www.w3.org/mid/CAGZNdJWe0Y=M_SWmgYabKbWZwPEuJdw67Km8+UtR4oUtZuXA5A@mail.gmail.com>
Resent-From: ietf-http-wg@w3.org
X-Mailing-List: <ietf-http-wg@w3.org> archive/latest/33302
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>

This question reminds me of a similiar issue we had a while ago at
mitmproxy: https://github.com/mitmproxy/mitmproxy/issues/1498

As far as I understand this, sending PRIORITY does not initiate a
stream or change the stream state.
HEADERS and PUSH_PROMISE initiate a stream. PRIORITY can be sent and
received in any stream state.

2017-01-17 7:32 GMT+01:00 Scott Mitchell <scott.k.mitch1@gmail.com>:
> (originally posted here: https://github.com/http2/http2-spec/issues/759)
>
> What is the expected result in terms of stream state and any potential
> errors that should be generated from the following scenario:
>
> ```
> 1. Client [PRIORITY, id: 5] -> Server
> 2. Client [HEADERS, id: 3] -> Server
> ```
>
> ## Option 1
> The server accepts both frames. Stream `3` is OPEN and stream `5` remains in
> IDLE.
>
> This behavior is verified in the h2spec verification tool via
> https://github.com/summerwind/h2spec/pull/67. Also see additional discussion
> there.
>
> ## Option 2
> Should the use of stream ID `5` cause stream ID `3` (and all lower stream
> IDs) to be implicitly closed according to the section-5.1.1 (see [1])? This
> would mean after the server receives the frame from step (1) it thinks that
> stream ID `3` has been closed, and when the server receives the frame from
> step (2) it will respond with a connection error of type PROTOCOL_ERROR (see
> [2])?
>
> [1] https://tools.ietf.org/html/rfc7540#section-5.1.1
>> 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.
>
> [2] https://tools.ietf.org/html/rfc7540#section-5.1.1
>> An endpoint that
>    receives an unexpected stream identifier MUST respond with a
>    connection error (Section 5.4.1) of type PROTOCOL_ERROR.
>