Re: INVALID_STREAM and STREAM_ALREADY_CLOSED

William Chan (陈智昌) <willchan@chromium.org> Tue, 26 March 2013 19:59 UTC

Return-Path: <ietf-http-wg-request@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 9224721F8BEA for <ietfarch-httpbisa-archive-bis2Juki@ietfa.amsl.com>; Tue, 26 Mar 2013 12:59:43 -0700 (PDT)
X-Virus-Scanned: amavisd-new at amsl.com
X-Spam-Flag: NO
X-Spam-Score: -9.676
X-Spam-Level:
X-Spam-Status: No, score=-9.676 tagged_above=-999 required=5 tests=[BAYES_00=-2.599, FM_FORGED_GMAIL=0.622, HTML_MESSAGE=0.001, MIME_8BIT_HEADER=0.3, RCVD_IN_DNSWL_HI=-8]
Received: from mail.ietf.org ([12.22.58.30]) by localhost (ietfa.amsl.com [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id jqL2zjojMw6T for <ietfarch-httpbisa-archive-bis2Juki@ietfa.amsl.com>; Tue, 26 Mar 2013 12:59:42 -0700 (PDT)
Received: from frink.w3.org (frink.w3.org [128.30.52.56]) by ietfa.amsl.com (Postfix) with ESMTP id B272E21F8A91 for <httpbisa-archive-bis2Juki@lists.ietf.org>; Tue, 26 Mar 2013 12:59:42 -0700 (PDT)
Received: from lists by frink.w3.org with local (Exim 4.72) (envelope-from <ietf-http-wg-request@listhub.w3.org>) id 1UKa17-0008AV-QO for ietf-http-wg-dist@listhub.w3.org; Tue, 26 Mar 2013 19:58:45 +0000
Resent-Date: Tue, 26 Mar 2013 19:58:45 +0000
Resent-Message-Id: <E1UKa17-0008AV-QO@frink.w3.org>
Received: from maggie.w3.org ([128.30.52.39]) by frink.w3.org with esmtp (Exim 4.72) (envelope-from <willchan@google.com>) id 1UKa0w-00087B-2W for ietf-http-wg@listhub.w3.org; Tue, 26 Mar 2013 19:58:34 +0000
Received: from mail-qc0-f178.google.com ([209.85.216.178]) by maggie.w3.org with esmtps (TLS1.0:RSA_ARCFOUR_SHA1:16) (Exim 4.72) (envelope-from <willchan@google.com>) id 1UKa0v-0007kD-2k for ietf-http-wg@w3.org; Tue, 26 Mar 2013 19:58:34 +0000
Received: by mail-qc0-f178.google.com with SMTP id d10so2636451qca.37 for <ietf-http-wg@w3.org>; Tue, 26 Mar 2013 12:58:06 -0700 (PDT)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20120113; h=mime-version:x-received:sender:in-reply-to:references:date :x-google-sender-auth:message-id:subject:from:to:cc:content-type; bh=wnO+soqtZL2BY6eHKaC9iYKbNWHV3R4o+OfjRnytCpk=; b=C7s6khYxsRr+fxnd4+iLyNKXT5Ed5XkinUSTuCEq7OWhd9zEt4NUMtiRYadnDgS/1c oCKZ4Efi1VU4m4/Kb9HFB5w31O/rl5Dh0RrPjwiml+PcMdDfyKJ31ALRAG/xx9kkDut+ MnHsT193vZpyQxudVmDq9NdkajSQdrsS6yPxR5uvRPfd3FBnkRTJRuzxfv3eTn6JJL7o QzTw+ChnWmTVMTQjAAzgCNa7dXtvXXUMdzT4Nq1tEMwfop13vyPBnYgz2bpE0KIS0nlV H4QIgDO9uDgCGSGUcCbxuBuAFLUs2nnpxfw7/Lt8gXc51gfGiOI+2isHneaccoXHL4pa dq/g==
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=chromium.org; s=google; h=mime-version:x-received:sender:in-reply-to:references:date :x-google-sender-auth:message-id:subject:from:to:cc:content-type; bh=wnO+soqtZL2BY6eHKaC9iYKbNWHV3R4o+OfjRnytCpk=; b=cZXb8SxXXk7nwscs6t/vhUUoMIL19fFacpJ+KZLKz2o+U8nAd/k4mNBKGAD2Ca9GSm X4jJcW9j3nhZ0vCFWHps/sDuHcpI8Et6a0Ey+zNSJ78uDdSroEZ2JmnrqXrt6mhGB1/q h/OL0bi2LCBgGhQCpSIvMGKUVSECqADSp6KPA=
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20120113; h=mime-version:x-received:sender:in-reply-to:references:date :x-google-sender-auth:message-id:subject:from:to:cc:content-type :x-gm-message-state; bh=wnO+soqtZL2BY6eHKaC9iYKbNWHV3R4o+OfjRnytCpk=; b=nYDuyYb4cRMZzlcjGeik0hGw701TJdz6/Agfu52AaVf11UZa0kQazeY8fInpRzm67w 5HvXarWH55cFJAM0FGEhBWhss1D3Mf+mTgTK++2k5eyHvBRaWaRCR4uZ5BWVWM65wFyi MwBAC7j3cHiYEm7JtTJvwoCjdSSM+zw3gm9247+eBPInkDoLtfOS97L0JbiLzq7syh/R H6CwiVP0/2fEWp//QaOQpPFcPLUWr8gBHj1g9Zj8cJzt5kS6iiEWPoSYKfWbhraeuNzR rSrqlm93Om72MWhXpwQebswCAAy7tpIFUuZtSpiOMPiWrv/vB+9UcoFlqLuFat+IrLA0 KLrw==
MIME-Version: 1.0
X-Received: by 10.49.62.2 with SMTP id u2mr10283865qer.22.1364327886091; Tue, 26 Mar 2013 12:58:06 -0700 (PDT)
Sender: willchan@google.com
Received: by 10.229.180.4 with HTTP; Tue, 26 Mar 2013 12:58:05 -0700 (PDT)
In-Reply-To: <CAP+FsNcy1KA0qs=knJzfyfcwjUbWAsWGB9zL5PjAFbrp+V5OwA@mail.gmail.com>
References: <CABkgnnX+26FBCk0VFTEC4sPBrt4DMqWSSdFcvFRVPVYLiCOLng@mail.gmail.com> <CAP+FsNcy1KA0qs=knJzfyfcwjUbWAsWGB9zL5PjAFbrp+V5OwA@mail.gmail.com>
Date: Tue, 26 Mar 2013 12:58:05 -0700
X-Google-Sender-Auth: 71904b8iFK1I2dD33KMYko8m6RI
Message-ID: <CAA4WUYj2T3QAC9wimrOHfU1V3C3hL2sXt4W81xGk8DZCGCnWpQ@mail.gmail.com>
From: "William Chan (陈智昌)" <willchan@chromium.org>
To: Roberto Peon <grmocg@gmail.com>
Cc: Martin Thomson <martin.thomson@gmail.com>, HTTP Working Group <ietf-http-wg@w3.org>
Content-Type: multipart/alternative; boundary="047d7bdc159e02184804d8d9572b"
X-Gm-Message-State: ALoCoQk6uq2kWjnnriYAl9JgLKeRXlD2surcVMAaCnRT6OyTH0+TMez0oq+VF+BhxtInw12Gyyd8I16yrIg9oEMoTB8IHMdO/wAyKMlEQiLS2cSSTtIjzCsTN/5NuTc6yNAJdDBkDdsOLq2ZHFrRxZFcXNaVfz6P9tx2VX69uU2SFjASFrIAOSZuih1Lj0uwGwlCvlQH1tcg
Received-SPF: pass client-ip=209.85.216.178; envelope-from=willchan@google.com; helo=mail-qc0-f178.google.com
X-W3C-Hub-Spam-Status: No, score=-5.1
X-W3C-Hub-Spam-Report: AWL=-1.090, BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, HTML_MESSAGE=0.001, RCVD_IN_DNSWL_LOW=-0.7, RP_MATCHES_RCVD=-1.302, SPF_PASS=-0.001
X-W3C-Scan-Sig: maggie.w3.org 1UKa0v-0007kD-2k bbe45c613e541ca6ae8ed587e2e6051b
X-Original-To: ietf-http-wg@w3.org
Subject: Re: INVALID_STREAM and STREAM_ALREADY_CLOSED
Archived-At: <http://www.w3.org/mid/CAA4WUYj2T3QAC9wimrOHfU1V3C3hL2sXt4W81xGk8DZCGCnWpQ@mail.gmail.com>
Resent-From: ietf-http-wg@w3.org
X-Mailing-List: <ietf-http-wg@w3.org> archive/latest/17149
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>

We used INVALID_STREAM to indicate the client received a SYN_STREAM with an
associated stream id that does not exist. Maybe we should just terminate
the session.

STREAM_ALREADY_CLOSED can be confusing since peers don't necessarily know
that it's already closed unless we maintain the set of old closed stream
ids. And what if we receive DATA frames for non-existent streams? I guess
we shouldn't RST_STREAM a non-existent stream, since the stream id is
invalid.


On Tue, Mar 26, 2013 at 12:34 PM, Roberto Peon <grmocg@gmail.com> wrote:

> imho: Seems reasonable for now.
> I expect that we'll expand the error codes as more implementors find error
> conditions that they want to be able to debug from a client debug
> information, at which point we can re-add any of this.
>
> -=R
>
>
> On Tue, Mar 26, 2013 at 11:23 AM, Martin Thomson <martin.thomson@gmail.com
> > wrote:
>
>> Another error code question.
>>
>> INVALID_STREAM indicates that a frame arrived for an "inactive" stream.
>>
>> STREAM_ALREADY_CLOSED indicates that a frame arrived for a (half-)closed
>> stream.
>>
>> Both are unexpected frames.  My first inclination was to suggest
>> (again) that a single error code was appropriate.
>>
>> However, if I read between the lines, INVALID_STREAM is as a result of
>> getting a frame prior to the first 'official' frame in the stream
>> (i.e., SYN_STREAM).  But the general design doesn't require that a
>> stream starts with any particular frame.
>>
>> So I conclude that it only makes sense to have STREAM_ALREADY_CLOSED.
>>
>>
>