Re: Lingering Close

"Roy T. Fielding" <fielding@gbiv.com> Sun, 19 May 2013 23:40 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 9B1D121F8E87 for <ietfarch-httpbisa-archive-bis2Juki@ietfa.amsl.com>; Sun, 19 May 2013 16:40:28 -0700 (PDT)
X-Virus-Scanned: amavisd-new at amsl.com
X-Spam-Flag: NO
X-Spam-Score: -10.599
X-Spam-Level:
X-Spam-Status: No, score=-10.599 tagged_above=-999 required=5 tests=[BAYES_00=-2.599, 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 fPWFz19A7LB5 for <ietfarch-httpbisa-archive-bis2Juki@ietfa.amsl.com>; Sun, 19 May 2013 16:40:19 -0700 (PDT)
Received: from frink.w3.org (frink.w3.org [128.30.52.56]) by ietfa.amsl.com (Postfix) with ESMTP id F27CF21F8DFC for <httpbisa-archive-bis2Juki@lists.ietf.org>; Sun, 19 May 2013 16:40:18 -0700 (PDT)
Received: from lists by frink.w3.org with local (Exim 4.72) (envelope-from <ietf-http-wg-request@listhub.w3.org>) id 1UeDBN-0002tt-PD for ietf-http-wg-dist@listhub.w3.org; Sun, 19 May 2013 23:38:29 +0000
Resent-Date: Sun, 19 May 2013 23:38:29 +0000
Resent-Message-Id: <E1UeDBN-0002tt-PD@frink.w3.org>
Received: from lisa.w3.org ([128.30.52.41]) by frink.w3.org with esmtp (Exim 4.72) (envelope-from <fielding@gbiv.com>) id 1UeDBC-0002sy-RZ for ietf-http-wg@listhub.w3.org; Sun, 19 May 2013 23:38:18 +0000
Received: from caiajhbdcaib.dreamhost.com ([208.97.132.81] helo=homiemail-a90.g.dreamhost.com) by lisa.w3.org with esmtp (Exim 4.72) (envelope-from <fielding@gbiv.com>) id 1UeDBB-0003rV-WA for ietf-http-wg@w3.org; Sun, 19 May 2013 23:38:18 +0000
Received: from homiemail-a90.g.dreamhost.com (localhost [127.0.0.1]) by homiemail-a90.g.dreamhost.com (Postfix) with ESMTP id EB4822AC064; Sun, 19 May 2013 16:37:56 -0700 (PDT)
DKIM-Signature: v=1; a=rsa-sha1; c=relaxed; d=gbiv.com; h=subject :mime-version:content-type:from:in-reply-to:date:cc :content-transfer-encoding:message-id:references:to; s=gbiv.com; bh=HQ7MHMApis93YLaGDH7LOH6fjWU=; b=SojZkSy7XELTCzpQZIYvcoKK9Rqj 6f3oJUSUg/pHgjBzZP7UQMXcs72rHCWHRczObj4Hma/wiqczRoRcmMYwtVZfKYhc BFXlQPpdbqWPrmWXGRN8QGJZCGqsPzuZk7pq9idXlCV836d5kLRMU38F/zDNIEi3 FArcyYlf4dXJAYE=
Received: from [192.168.1.84] (99-21-208-82.lightspeed.irvnca.sbcglobal.net [99.21.208.82]) (using TLSv1 with cipher AES128-SHA (128/128 bits)) (No client certificate requested) (Authenticated sender: fielding@gbiv.com) by homiemail-a90.g.dreamhost.com (Postfix) with ESMTPSA id A65B52AC05D; Sun, 19 May 2013 16:37:56 -0700 (PDT)
Mime-Version: 1.0 (Apple Message framework v1283)
Content-Type: text/plain; charset="iso-8859-1"
From: "Roy T. Fielding" <fielding@gbiv.com>
In-Reply-To: <CACuKZqGcDvFu_r=DWKPv2AkhcbDgoB6jOam3GMLJoz9HFEFSEg@mail.gmail.com>
Date: Sun, 19 May 2013 16:38:05 -0700
Cc: HTTP Working Group <ietf-http-wg@w3.org>
Content-Transfer-Encoding: 7bit
Message-Id: <ECED220A-63AA-44B7-BB8C-224A1340FAB2@gbiv.com>
References: <CACuKZqGcDvFu_r=DWKPv2AkhcbDgoB6jOam3GMLJoz9HFEFSEg@mail.gmail.com>
To: Zhong Yu <zhong.j.yu@gmail.com>
X-Mailer: Apple Mail (2.1283)
Received-SPF: none client-ip=208.97.132.81; envelope-from=fielding@gbiv.com; helo=homiemail-a90.g.dreamhost.com
X-W3C-Hub-Spam-Status: No, score=-3.5
X-W3C-Hub-Spam-Report: AWL=-3.392, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, RCVD_IN_DNSWL_NONE=-0.0001
X-W3C-Scan-Sig: lisa.w3.org 1UeDBB-0003rV-WA d3d51245ba324e7146ae0eb21a775085
X-Original-To: ietf-http-wg@w3.org
Subject: Re: Lingering Close
Archived-At: <http://www.w3.org/mid/ECED220A-63AA-44B7-BB8C-224A1340FAB2@gbiv.com>
Resent-From: ietf-http-wg@w3.org
X-Mailing-List: <ietf-http-wg@w3.org> archive/latest/18031
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 was addressed in passing for a related issue ...

http://trac.tools.ietf.org/wg/httpbis/trac/changeset/2257

....Roy

On Nov 28, 2012, at 9:08 AM, Zhong Yu wrote:

> http://tools.ietf.org/html/draft-ietf-httpbis-p1-messaging-21#section-6.2.5
> 6.2.5. Tear-down
> 
>   A server that receives a close connection option *MUST initiate a
>   lingering close* of the connection after it sends the final response
>   to the request that contained close.
> 
>   A server that sends a close connection option *MUST initiate a
>   lingering close* of the connection after it sends the response
>   containing close.
> 
> The 2 MUSTs (of lingering close) are too strong here; a server may
> reason that a simple close is enough since there shouldn't be any more
> data from client, due to
>  1. the request is HTTP/1.0 without "Connection:keep-alive".
>  2. the request contains "Connection:close"
> We can weaken the texts to "MUST close the connection", and discuss
> later when a "lingering close" is needed.
> 
> The description of "lingering close" also seems a little off. We
> shouldn't ask servers to "half-close" first, because
> 
>  1. Half-close is useless since an HTTP/1.1 client usually won't
> detect it. The client reads to the end of the response and stops, it
> won't read again to find out the EOF. (For HTTP/1.0, EOF is required,
> but it's not part of the discussion of lingering close)
> 
>  2. Some APIs do not support half-close. Examples in Java: SSL
> socket, Netty channel.
> 
> So we can remove the "half-close" step from "lingering close" process;
> the process is simply: drain inbound data, then close the connection.
> 
> This "lingering close" process should work for abstract transport
> protocols, as long as the server, while reading from client, can
> detect that the client has closed the connection.
> 
> Zhong Yu
>