Re: [hybi] Clarify the role of closing handshake

Takeshi Yoshino <tyoshino@google.com> Tue, 15 February 2011 23:53 UTC

Return-Path: <tyoshino@google.com>
X-Original-To: hybi@core3.amsl.com
Delivered-To: hybi@core3.amsl.com
Received: from localhost (localhost [127.0.0.1]) by core3.amsl.com (Postfix) with ESMTP id DA5803A6C37 for <hybi@core3.amsl.com>; Tue, 15 Feb 2011 15:53:13 -0800 (PST)
X-Virus-Scanned: amavisd-new at amsl.com
X-Spam-Flag: NO
X-Spam-Score: -104.976
X-Spam-Level:
X-Spam-Status: No, score=-104.976 tagged_above=-999 required=5 tests=[AWL=1.000, BAYES_00=-2.599, FM_FORGED_GMAIL=0.622, HTML_MESSAGE=0.001, RCVD_IN_DNSWL_MED=-4, USER_IN_WHITELIST=-100]
Received: from mail.ietf.org ([64.170.98.32]) by localhost (core3.amsl.com [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id Mdm2ms7ToJYI for <hybi@core3.amsl.com>; Tue, 15 Feb 2011 15:53:12 -0800 (PST)
Received: from smtp-out.google.com (smtp-out.google.com [74.125.121.67]) by core3.amsl.com (Postfix) with ESMTP id 6B75B3A6C9E for <hybi@ietf.org>; Tue, 15 Feb 2011 15:53:12 -0800 (PST)
Received: from hpaq13.eem.corp.google.com (hpaq13.eem.corp.google.com [172.25.149.13]) by smtp-out.google.com with ESMTP id p1FNrc8Q005776 for <hybi@ietf.org>; Tue, 15 Feb 2011 15:53:38 -0800
DKIM-Signature: v=1; a=rsa-sha1; c=relaxed/relaxed; d=google.com; s=beta; t=1297814018; bh=VJmoAvNiu+nJVnFwqrWx0p/lGzk=; h=MIME-Version:In-Reply-To:References:From:Date:Message-ID:Subject: To:Cc:Content-Type; b=bAZlq4eFqBTBlL5xcf9W36YGR1jHir4IGWK49DfWoxWzr8DK3if0SgvdtkEH0U2EH hYTMSQIyhlINvWE5gUUnQ==
Received: from iwn6 (iwn6.prod.google.com [10.241.68.70]) by hpaq13.eem.corp.google.com with ESMTP id p1FNpUGM021240 (version=TLSv1/SSLv3 cipher=RC4-SHA bits=128 verify=NOT) for <hybi@ietf.org>; Tue, 15 Feb 2011 15:53:37 -0800
Received: by iwn6 with SMTP id 6so878892iwn.15 for <hybi@ietf.org>; Tue, 15 Feb 2011 15:53:36 -0800 (PST)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=beta; h=domainkey-signature:mime-version:in-reply-to:references:from:date :message-id:subject:to:cc:content-type; bh=NBc+e/Nlk3N+fhlXEXZQUrmiUM94AwUmStB+7g3ohZs=; b=uUf62ftPPfmE8K/c3Clje3I9NfoZmB+UyEV5EILyvS+Dpf/OzJWFn6qXtxLrzbfcg2 YEI7gIiZ1XK+dkR9NMMA==
DomainKey-Signature: a=rsa-sha1; c=nofws; d=google.com; s=beta; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :cc:content-type; b=IbSwvQVhQRzAxnC+3WySnn/XDWX5Xcjo3agz9pWw5tAf7kSjde4uEmN+K5NsUMEFli B+RsBlvr4TfK3uIPhD9Q==
Received: by 10.231.39.73 with SMTP id f9mr10237ibe.79.1297814016177; Tue, 15 Feb 2011 15:53:36 -0800 (PST)
MIME-Version: 1.0
Received: by 10.231.17.201 with HTTP; Tue, 15 Feb 2011 15:53:16 -0800 (PST)
In-Reply-To: <AANLkTimpa0A8UbS-N+d2NsHzYyCibvq9TXyDF9yZaT14@mail.gmail.com>
References: <4D5AE318.9080308@stpeter.im> <OF9E69202E.36384265-ON88257838.00749E83-88257838.007782CA@playstation.sony.com> <AANLkTin+5mxtbD4GbNK1X2P3CEyLQngOB06qj9sN-Gjh@mail.gmail.com> <AANLkTimpa0A8UbS-N+d2NsHzYyCibvq9TXyDF9yZaT14@mail.gmail.com>
From: Takeshi Yoshino <tyoshino@google.com>
Date: Tue, 15 Feb 2011 15:53:16 -0800
Message-ID: <AANLkTim51OKk-QUX=mmZN3ptOuPZ2WKsW_nzt1SzsgAD@mail.gmail.com>
To: Justin Lee <jlee@antwerkz.com>
Content-Type: multipart/alternative; boundary="0003255752fe6b3705049c5adf2d"
X-System-Of-Record: true
Cc: hybi@ietf.org
Subject: Re: [hybi] Clarify the role of closing handshake
X-BeenThere: hybi@ietf.org
X-Mailman-Version: 2.1.9
Precedence: list
List-Id: Server-Initiated HTTP <hybi.ietf.org>
List-Unsubscribe: <https://www.ietf.org/mailman/listinfo/hybi>, <mailto:hybi-request@ietf.org?subject=unsubscribe>
List-Archive: <http://www.ietf.org/mail-archive/web/hybi>
List-Post: <mailto:hybi@ietf.org>
List-Help: <mailto:hybi-request@ietf.org?subject=help>
List-Subscribe: <https://www.ietf.org/mailman/listinfo/hybi>, <mailto:hybi-request@ietf.org?subject=subscribe>
X-List-Received-Date: Tue, 15 Feb 2011 23:53:14 -0000

On Tue, Feb 15, 2011 at 14:49, Justin Lee <jlee@antwerkz.com> wrote:

>
>
> On Tue, Feb 15, 2011 at 5:45 PM, Takeshi Yoshino <tyoshino@google.com>wrote:
>
>> On Tue, Feb 15, 2011 at 13:45, <Yutaka_Takeda@playstation.sony.com>wrote:
>>
>>>
>>> Okay, I admit my example was bad.
>>>
>>> Just to be clear, even with this code:
>>>
>>>       websocket.send("a-message-needs-to-reach-server")
>>>       websocket.close()
>>>
>>> From your opinions, programmers should not expect that the message always
>>> reach the server. (granted)
>>>
>>>
>> Yes, this point should be noted in the spec, or developers may
>> misunderstand.
>>
>
> In the grizzly version, I actually just queue up the close frame behind the
> others.  Is this not what should happen?  Should the close frame jump to the
> front of the line?
>
>

At least I can say that is not incorrect behavior. Whether "Send something"
in *start the WebSocket closing handshake* algorithm should break in or just
queue behind the others is not specified in the spec, I think. IMO, we
should queue Close frame behind the others. If close() breaks in, preceding
send()s are cancelled. That's bad programming model though I can imagine
some implementation might have urgent_close() or something that breaks in if
they need. FYI, we queue a Close frame behind the others in pywebsocket,
too.

Here what we're talking about is how to let the client know if
"a-message-needs-to-reach-server" is received by the other peer or not by
using closing handshake. Even "a-message-needs-to-reach-server" is queued
before a Close frame, it's possible that it cannot make it to the other peer
for some network problem, etc.