Re: [quicwg/base-drafts] Move GOAWAY from transport to HTTP (#697)
Martin Thomson <notifications@github.com> Thu, 27 July 2017 01:10 UTC
Return-Path: <noreply@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 69073131F3E for <quic-issues@ietfa.amsl.com>; Wed, 26 Jul 2017 18:10:45 -0700 (PDT)
X-Virus-Scanned: amavisd-new at amsl.com
X-Spam-Flag: NO
X-Spam-Score: -9.299
X-Spam-Level:
X-Spam-Status: No, score=-9.299 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, RCVD_IN_DNSWL_HI=-5, RCVD_IN_MSPIKE_H2=-2.8, RCVD_IN_SORBS_SPAM=0.5, 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 8FyivOVwF8SF for <quic-issues@ietfa.amsl.com>; Wed, 26 Jul 2017 18:10:41 -0700 (PDT)
Received: from github-smtp2b-ext-cp1-prd.iad.github.net (github-smtp2-ext3.iad.github.net [192.30.252.194]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by ietfa.amsl.com (Postfix) with ESMTPS id 9D950131F3B for <quic-issues@ietf.org>; Wed, 26 Jul 2017 18:10:39 -0700 (PDT)
Date: Wed, 26 Jul 2017 18:10:38 -0700
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=github.com; s=pf2014; t=1501117838; bh=03j9iAtjCs+YP4o+4i7oQ3SlHJUHexBC6YzGikr4MdY=; h=From:Reply-To:To:Cc:In-Reply-To:References:Subject:List-ID: List-Archive:List-Post:List-Unsubscribe:From; b=hYHwG/UKana5qEp7mD0tZfbGbB7uQiyKW0TL5aEySqxpnbaVXPAStZGOPIyRQ29k5 0OLklvTQJupudjXW+2fxvQmlo5eRHbth4Kr8y083p9sb4jLR8kZ0OKejdSWlo7V2au cxbPqnKnnPkF9W/1HKudHT8FE00LrUKKObAY2IRk=
From: Martin Thomson <notifications@github.com>
Reply-To: quicwg/base-drafts <reply+0166e4abb6e2cd2d307c70e39d446b4054a8a15f8719465292cf000000011590ff8e92a169ce0ea70488@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/52534677@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_59793d8ebfe64_7bba3ffb703cfc3414271e"; 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
Archived-At: <https://mailarchive.ietf.org/arch/msg/quic-issues/_mHpI4RaBzgXV_ZbIwp3F9kBGl4>
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: Thu, 27 Jul 2017 01:10:45 -0000
martinthomson requested changes on this pull request.
I think that this is the right general approach, though I would want to discuss on the list first.
There is a specific part of the design that I don't think works here (or in h2). That might be something we discuss separately though. I'll raise that on the issue, so that we don't get side-tracked with discussion on PRs.
> +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.
+
+The last stream identifier in the GOAWAY frame contains the highest-numbered
+stream identifier for which the sender of the GOAWAY frame might have taken some
+action on or might yet take action on. All streams up to and including the
+identified stream might have been processed in some way. The last stream
+identifier can be set to 0 if no streams were processed.
+
+> 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.
+
+If a connection terminates without a GOAWAY frame, the last stream identifier is
+effectively the highest possible stream identifier.
MAX_STREAM_ID determines this...
> +
+The GOAWAY frame does not define any flags.
+
+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.
+
+The last stream identifier in the GOAWAY frame contains the highest-numbered
+stream identifier for which the sender of the GOAWAY frame might have taken some
+action on or might yet take action on. All streams up to and including the
+identified stream might have been processed in some way. The last stream
+identifier can be set to 0 if no streams were processed.
+
+> 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.
style nit: use a DL for the note:
```
Note:
: In this context, ...
```
> +identified by a QUIC MAX_STREAM_ID frame.
+
+Once sent, the sender will refuse requests sent on streams initiated by the
+receiver if the stream has an identifier higher than the included last stream
+identifier. Receivers of a GOAWAY frame MUST NOT send new requests on the
+connection, although a new connection can be established for new streams.
+
+If the receiver of the GOAWAY has sent requests on streams with a higher stream
+identifier than what is indicated in the GOAWAY frame, those streams are not or
+will not be processed. The receiver of the GOAWAY frame can treat the requests
+as though they had never been sent at all, thereby allowing those requests to be
+retried later on a new connection. Servers SHOULD treat requests on streams
+above this ID as stream errors of type HTTP_REQUEST_CANCELLED.
+
+Endpoints SHOULD send a GOAWAY frame when the closing of a connection is known
+in advance, even if the window is small, so that the remote peer can know
What is "the window"? I think that the point here is that you send the GOAWAY even if there is not guarantee that there will be time to ensure that the GOAWAY is properly received. I think that includes cases where you might be sending a CONNECTION_CLOSE in response to an error condition.
Note that sending GOAWAY suffers from HOLB, which makes this a less than ideal solution. I have some ideas about how we might avoid that, but it's an even more dramatic shift in the protocol design than unidirectional streams. So much so that @ianswett might have an aneurysm.
> +will not be processed. The receiver of the GOAWAY frame can treat the requests
+as though they had never been sent at all, thereby allowing those requests to be
+retried later on a new connection. Servers SHOULD treat requests on streams
+above this ID as stream errors of type HTTP_REQUEST_CANCELLED.
+
+Endpoints SHOULD send a GOAWAY frame when the closing of a connection is known
+in advance, even if the window is small, so that the remote peer can know
+whether a stream has been partially processed or not. For example, if an HTTP
+client sends a POST at the same time that a server closes a QUIC connection, the
+client cannot know if the server started to process that POST request if the
+server does not send a GOAWAY frame to indicate what streams it might have acted
+on.
+
+For unexpected closures caused by error conditions, transport-level mechanisms
+SHOULD be used. However, a GOAWAY MAY still be sent to provide additional
+detail to clients.
Rather than say "transport-level mechanisms", just mention CONNECTION_CLOSE explicitly.
Secondly, the important "additional detail" here is the stream identifier. I think that we should remove the error code and debug data (you will note that these were removed from the transport-layer GOAWAY).
> +The last stream identifier in the GOAWAY frame contains the highest-numbered
+stream identifier for which the sender of the GOAWAY frame might have taken some
+action on or might yet take action on. All streams up to and including the
+identified stream might have been processed in some way. The last stream
+identifier can be set to 0 if no streams were processed.
+
+> 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.
+
+If a connection terminates without a GOAWAY frame, the last stream identifier is
+effectively the highest possible stream identifier.
+
+Reattempting requests on streams with lower- or equal-numbered identifiers is
+not possible, with the exception of idempotent actions like HTTP GET, PUT, or
+DELETE. Any protocol activity that used higher-numbered streams can be safely
This is probably cribbed from RFC 7450 (as is most of this), however it could be improved. I think that you want to concentrate first on what this guarantees (requests on higher stream numbers can be retried automatically), then note that other streams cannot be automatically retried unless it is otherwise permitted (for example, a request with an idempotent method).
> +> 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.
+
+If a connection terminates without a GOAWAY frame, the last stream identifier is
+effectively the highest possible stream identifier.
+
+Reattempting requests on streams with lower- or equal-numbered identifiers is
+not possible, with the exception of idempotent actions like HTTP GET, PUT, or
+DELETE. Any protocol activity that used higher-numbered streams can be safely
+retried using a new connection.
+
+Activity on streams numbered lower or equal to the last stream identifier might
+still complete successfully. The sender of a GOAWAY frame might gracefully shut
+down a connection by sending a GOAWAY frame, maintaining the connection in an
+"open" state until all in-progress streams complete.
We can be more concrete about this. Say that GOAWAY doesn't cause the connection to close, and the connection will remain open until requests on streams up to the last stream ID have completed. After that, the connection can be closed (let's avoid making a statement about silent close vs. a signaled close at this point by remaining silent on exactly *how* it is closed).
> +still complete successfully. The sender of a GOAWAY frame might gracefully shut
+down a connection by sending a GOAWAY frame, maintaining the connection in an
+"open" state until all in-progress streams complete.
+
+An endpoint MAY send multiple GOAWAY frames if circumstances change. For
+instance, an endpoint that sends GOAWAY without an error code during graceful
+shutdown could subsequently encounter an error condition. The last stream
+identifier from the last GOAWAY frame received indicates which streams could
+have been acted upon. Endpoints MUST NOT increase the value they send in the
+last stream identifier, since the peers might already have retried unprocessed
+requests on another connection.
+
+A client that is unable to retry requests loses all requests that are in flight
+when the server closes the connection. A server that is attempting to
+gracefully shut down a connection SHOULD send an initial GOAWAY frame with the
+last stream identifier set to 2^32-1. This signals to the client that a
This requirement is no longer correct because we have MAX_STREAM_ID to govern this. You can send a GOAWAY with the value of MAX_STREAM_ID and be reasonably sure that all in-flight requests are covered.
> +identifier from the last GOAWAY frame received indicates which streams could
+have been acted upon. Endpoints MUST NOT increase the value they send in the
+last stream identifier, since the peers might already have retried unprocessed
+requests on another connection.
+
+A client that is unable to retry requests loses all requests that are in flight
+when the server closes the connection. A server that is attempting to
+gracefully shut down a connection SHOULD send an initial GOAWAY frame with the
+last stream identifier set to 2^32-1. This signals to the client that a
+shutdown is imminent and that initiating further requests is prohibited. After
+allowing time for any in-flight requests (at least one round-trip time), the
+server MAY send another GOAWAY frame with an updated last stream identifier.
+This ensures that a connection can be cleanly shut down without losing requests.
+
+After sending a GOAWAY frame, the sender MUST reset any existing or subsequently
+opened streams with an HTTP_REQUEST_CANCELLED error code.
I think that this paragraph is incorrect. I think that there is a missing condition here: it only does this if it wants to allow those requests to be retried.
> +
+An endpoint MAY send multiple GOAWAY frames if circumstances change. For
+instance, an endpoint that sends GOAWAY without an error code during graceful
+shutdown could subsequently encounter an error condition. The last stream
+identifier from the last GOAWAY frame received indicates which streams could
+have been acted upon. Endpoints MUST NOT increase the value they send in the
+last stream identifier, since the peers might already have retried unprocessed
+requests on another connection.
+
+A client that is unable to retry requests loses all requests that are in flight
+when the server closes the connection. A server that is attempting to
+gracefully shut down a connection SHOULD send an initial GOAWAY frame with the
+last stream identifier set to 2^32-1. This signals to the client that a
+shutdown is imminent and that initiating further requests is prohibited. After
+allowing time for any in-flight requests (at least one round-trip time), the
+server MAY send another GOAWAY frame with an updated last stream identifier.
There's an open question here about whether a recipient of GOAWAY can initiate any more requests. I don't think that we were sufficient clear about that in h2; this is similarly unclear. I think that we should allow for new requests to be initiated here; after all, we have no clear demarcation point that can be used. I think that we might advise against increasing MAX_STREAM_ID after sending GOAWAY (at least on the server side). But that goes back to my other comments, which you will soon see on the issue.
--
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-52534677
- [quicwg/base-drafts] Move GOAWAY from transport t… Mike Bishop
- Re: [quicwg/base-drafts] Move GOAWAY from transpo… Mike Bishop
- Re: [quicwg/base-drafts] Move GOAWAY from transpo… Martin Thomson
- Re: [quicwg/base-drafts] Move GOAWAY from transpo… Mike Bishop
- Re: [quicwg/base-drafts] Move GOAWAY from transpo… Mike Bishop
- Re: [quicwg/base-drafts] Move GOAWAY from transpo… Martin Thomson
- Re: [quicwg/base-drafts] Move GOAWAY from transpo… Mike Bishop
- Re: [quicwg/base-drafts] Move GOAWAY from transpo… Mike Bishop
- Re: [quicwg/base-drafts] Move GOAWAY from transpo… Mike Bishop
- Re: [quicwg/base-drafts] Move GOAWAY from transpo… Martin Thomson
- Re: [quicwg/base-drafts] Move GOAWAY from transpo… Mike Bishop
- Re: [quicwg/base-drafts] Move GOAWAY from transpo… Mike Bishop
- Re: [quicwg/base-drafts] Move GOAWAY from transpo… Martin Thomson
- Re: [quicwg/base-drafts] Move GOAWAY from transpo… Mike Bishop