Re: [quicwg/base-drafts] Move GOAWAY from transport to HTTP (#697)

Martin Thomson <notifications@github.com> Mon, 31 July 2017 02:45 UTC

Return-Path: <bounces+848413-a050-quic-issues=ietf.org@sgmail.github.com>
X-Original-To: quic-issues@ietfa.amsl.com
Delivered-To: quic-issues@ietfa.amsl.com
Received: from localhost (localhost [127.0.0.1]) by ietfa.amsl.com (Postfix) with ESMTP id 1C08C131D1E for <quic-issues@ietfa.amsl.com>; Sun, 30 Jul 2017 19:45:59 -0700 (PDT)
X-Virus-Scanned: amavisd-new at amsl.com
X-Spam-Flag: NO
X-Spam-Score: -2
X-Spam-Level:
X-Spam-Status: No, score=-2 tagged_above=-999 required=5 tests=[BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, HTML_MESSAGE=0.001, RP_MATCHES_RCVD=-0.001, SPF_PASS=-0.001, URIBL_BLOCKED=0.001] autolearn=ham autolearn_force=no
Authentication-Results: ietfa.amsl.com (amavisd-new); dkim=pass (1024-bit key) header.d=github.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 3XRPu_AXrYLF for <quic-issues@ietfa.amsl.com>; Sun, 30 Jul 2017 19:45:55 -0700 (PDT)
Received: from o4.sgmail.github.com (o4.sgmail.github.com [192.254.112.99]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by ietfa.amsl.com (Postfix) with ESMTPS id 54B0A131D29 for <quic-issues@ietf.org>; Sun, 30 Jul 2017 19:45:53 -0700 (PDT)
DKIM-Signature: v=1; a=rsa-sha1; c=relaxed/relaxed; d=github.com; h=from:reply-to:to:cc:in-reply-to:references:subject:mime-version:content-type:content-transfer-encoding:list-id:list-archive:list-post:list-unsubscribe; s=s20150108; bh=/s6lLDzFsOTF3rKd97Nq9LEYCZ8=; b=ix25nHNIyWjI8fEj DFOQqPhH/tZaFKs29OElUfZisczCKi4nkCzD+WHz5Olr2nSWNtyY2HHeF5NQqdhm +lr8VKHMtrmblfJ9R+rF1sYXzUQavgFgSlXM/RXw0Ds8uNDeblsy+zmAM0hliy8P w1c177dDnw2pYs8crvf3E2sOzho=
Received: by filter1150p1mdw1.sendgrid.net with SMTP id filter1150p1mdw1-24101-597E99E0-7 2017-07-31 02:45:52.171674521 +0000 UTC
Received: from github-smtp2b-ext-cp1-prd.iad.github.net (github-smtp2b-ext-cp1-prd.iad.github.net [192.30.253.17]) by ismtpd0039p1mdw1.sendgrid.net (SG) with ESMTP id oSXgciB7RguyonTrfEBvoQ for <quic-issues@ietf.org>; Mon, 31 Jul 2017 02:45:52.123 +0000 (UTC)
Date: Mon, 31 Jul 2017 02:45:52 +0000
From: Martin Thomson <notifications@github.com>
Reply-To: quicwg/base-drafts <reply+0166e4ab07720d93183cd5a30b0d06194e65f20cff78626592cf0000000115965bdf92a169ce0ea70488@reply.github.com>
To: quicwg/base-drafts <base-drafts@noreply.github.com>
Cc: Subscribed <subscribed@noreply.github.com>
Message-ID: <quicwg/base-drafts/pull/697/review/53117183@github.com>
In-Reply-To: <quicwg/base-drafts/pull/697@github.com>
References: <quicwg/base-drafts/pull/697@github.com>
Subject: Re: [quicwg/base-drafts] Move GOAWAY from transport to HTTP (#697)
Mime-Version: 1.0
Content-Type: multipart/alternative; boundary="--==_mimepart_597e99dfc8470_33683fe20032dc38205bd"; charset="UTF-8"
Content-Transfer-Encoding: 7bit
Precedence: list
X-GitHub-Sender: martinthomson
X-GitHub-Recipient: quic-issues
X-GitHub-Reason: subscribed
X-Auto-Response-Suppress: All
X-GitHub-Recipient-Address: quic-issues@ietf.org
X-SG-EID: l64QuQ2uJCcEyUykJbxN122A6QRmEpucztpreh3Pak3fhymBB80rRTHoRAPEmkbk0HA84jZN6E9C8g WQP4/RWt2xWeseGN/4SqPmTGtgqYPXnHtJsDl6PtX7cwsmOt50FgPFIaSW35OSTpktNCB3aybA6WTz M1WFM9L4P+8tVX0HeGncmYbzvfCK6ckgZy9LcU5lgdyIF1g3TIUnqaNv4L0xaupQPJCWq429iCsPfE E=
Archived-At: <https://mailarchive.ietf.org/arch/msg/quic-issues/jIpGOfBN9OwPUdzq9T3nW_3s6w0>
X-BeenThere: quic-issues@ietf.org
X-Mailman-Version: 2.1.22
List-Id: Notification list for GitHub issues related to the QUIC WG <quic-issues.ietf.org>
List-Unsubscribe: <https://www.ietf.org/mailman/options/quic-issues>, <mailto:quic-issues-request@ietf.org?subject=unsubscribe>
List-Archive: <https://mailarchive.ietf.org/arch/browse/quic-issues/>
List-Post: <mailto:quic-issues@ietf.org>
List-Help: <mailto:quic-issues-request@ietf.org?subject=help>
List-Subscribe: <https://www.ietf.org/mailman/listinfo/quic-issues>, <mailto:quic-issues-request@ietf.org?subject=subscribe>
X-List-Received-Date: Mon, 31 Jul 2017 02:45:59 -0000

martinthomson approved this pull request.

I wonder if now is the right time to suggest that we call this frame SHUTDOWN rather than GTFO.

> @@ -591,6 +591,83 @@ The payload consists of:
   : HPACK-compressed request headers for the promised response.
 
 
+### GOAWAY {#frame-goaway}
+
+The GOAWAY frame (type=0x7) is used to initiate graceful shutdown of a
+connection by a server.  GOAWAY allows a server to stop accepting new requests
+while still finishing processing of previously received requests.  This enables
+administrative actions, like server maintenance.  GOAWAY by itself does not
+close a connection.
+
+The GOAWAY frame does not define any flags, and the payload is a QUIC stream
+identifier.  The GOAWAY frame applies to the connection, not a specific stream.
+An endpoint MUST treat a GOAWAY frame on a stream other than the control stream
+as a connection error ({{errors}}) of type HTTP_WRONG_STREAM.
+
+There is an inherent race condition between a client sending new requests and
+the server sending a GOAWAY frame.  To deal with this case, the GOAWAY contains

We never explained the nature of that race condition in 7540, and now it's bugging me.  Should we open an issue to track this?

Maybe the right way to fix this is to change the description.  Say that this frame exists to allow client and server to agree on what requests were accepted and which were rejected.  GOAWAY identifies the last request that the client can make and the server will accept.  All requests that are sent on higher-numbered streams are implicitly cancelled.

Described that way, there isn't a need to talk about the race condition.

> +GOAWAY frame.
+
+  Note:
+  : In this context, "processed" means that some data from the stream was
+    passed to some higher layer of software that might have taken some action as
+    a result.
+
+Once sent, the server will refuse requests sent on streams with an identifier
+higher than the included last stream identifier.  Clients MUST NOT send new
+requests on the connection after receiving GOAWAY, although requests might
+already be in transit. A new connection can be established for new requests.
+
+If the client has sent requests on streams with a higher stream identifier than
+indicated in the GOAWAY frame, those requests were not and will not be
+processed.  Servers SHOULD reset new streams above this ID with the error code
+HTTP_REQUEST_CANCELLED.  Servers MAY also reset streams below the indicated ID

s/Servers SHOULD reset new streams/Endpoints SHOULD reset client-initiated streams/

It's not especially graceful, but the server might see those streams as open, and cancelling them avoids problems.  Also, this isn't about the server, because clients should also reset their requests and avoid retransmissions.  


Separately, I wonder: HTTP_REQUEST_CANCELLED from the client doesn't have the effect that we want: it doesn't guarantee that the request wasn't processed by the server; it can't.  Do we need some text on that.

> +  : In this context, "processed" means that some data from the stream was
+    passed to some higher layer of software that might have taken some action as
+    a result.
+
+Once sent, the server will refuse requests sent on streams with an identifier
+higher than the included last stream identifier.  Clients MUST NOT send new
+requests on the connection after receiving GOAWAY, although requests might
+already be in transit. A new connection can be established for new requests.
+
+If the client has sent requests on streams with a higher stream identifier than
+indicated in the GOAWAY frame, those requests were not and will not be
+processed.  Servers SHOULD reset new streams above this ID with the error code
+HTTP_REQUEST_CANCELLED.  Servers MAY also reset streams below the indicated ID
+with HTTP_REQUEST_CANCELLED if the associated requests were not processed.
+
+The client can treat these requests as though they had never been sent at all,

A client can treat requests that are cancelled by the server as though they have never been sent

If the client cancels them, then they still might be live.  (Yeah, this is in the context of a server-sent thing, but it's better to have an accurate context-free statement.)

> @@ -591,6 +591,83 @@ The payload consists of:
   : HPACK-compressed request headers for the promised response.
 
 
+### GOAWAY {#frame-goaway}
+
+The GOAWAY frame (type=0x7) is used to initiate graceful shutdown of a
+connection by a server.  GOAWAY allows a server to stop accepting new requests
+while still finishing processing of previously received requests.  This enables
+administrative actions, like server maintenance.  GOAWAY by itself does not
+close a connection.

I think that we should explicitly say that a client doesn't need to send GOAWAY: it just stops sending requests.

> +The GOAWAY frame (type=0x7) is used to initiate graceful shutdown of a
+connection by a server.  GOAWAY allows a server to stop accepting new requests
+while still finishing processing of previously received requests.  This enables
+administrative actions, like server maintenance.  GOAWAY by itself does not
+close a connection.
+
+The GOAWAY frame does not define any flags, and the payload is a QUIC stream
+identifier.  The GOAWAY frame applies to the connection, not a specific stream.
+An endpoint MUST treat a GOAWAY frame on a stream other than the control stream
+as a connection error ({{errors}}) of type HTTP_WRONG_STREAM.
+
+There is an inherent race condition between a client sending new requests and
+the server sending a GOAWAY frame.  To deal with this case, the GOAWAY contains
+the stream identifier of the last client-initiated request that was or might be
+processed in this connection.  This MAY be lower than the stream limit
+identified by a QUIC MAX_STREAM_ID frame, and MAY be zero if no requsets were

typo: requsets

> +higher than the included last stream identifier.  Clients MUST NOT send new
+requests on the connection after receiving GOAWAY, although requests might
+already be in transit. A new connection can be established for new requests.
+
+If the client has sent requests on streams with a higher stream identifier than
+indicated in the GOAWAY frame, those requests were not and will not be
+processed.  Servers SHOULD reset new streams above this ID with the error code
+HTTP_REQUEST_CANCELLED.  Servers MAY also reset streams below the indicated ID
+with HTTP_REQUEST_CANCELLED if the associated requests were not processed.
+
+The client can treat these requests as though they had never been sent at all,
+thereby allowing them to be retried later on a new connection. Automatically
+retrying other requests is not possible, unless this is otherwise permitted
+(e.g. idempotent actions like GET, PUT, or DELETE).  Requests on stream IDs less
+than or equals to the stream ID in the GOAWAY frame remain open until they are
+completed successfully, reset, or the connection terminates.

The "remain open" clause here is potentially confusing.  The problem here is that stream state can't be affected by these HTTP frames.  I think that you might remove this last sentence.

-- 
You are receiving this because you are subscribed to this thread.
Reply to this email directly or view it on GitHub:
https://github.com/quicwg/base-drafts/pull/697#pullrequestreview-53117183