Re: [hybi] Straw poll: Do you miss interjectable WebSocket level control frame? (was: Re: Discontinuation of mux ...)

Takeshi Yoshino <tyoshino@google.com> Tue, 25 February 2014 22:05 UTC

Return-Path: <tyoshino@google.com>
X-Original-To: hybi@ietfa.amsl.com
Delivered-To: hybi@ietfa.amsl.com
Received: from localhost (ietfa.amsl.com [127.0.0.1]) by ietfa.amsl.com (Postfix) with ESMTP id D17EC1A07C1 for <hybi@ietfa.amsl.com>; Tue, 25 Feb 2014 14:05:25 -0800 (PST)
X-Virus-Scanned: amavisd-new at amsl.com
X-Spam-Flag: NO
X-Spam-Score: 1.174
X-Spam-Level: *
X-Spam-Status: No, score=1.174 tagged_above=-999 required=5 tests=[BAYES_40=-0.001, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, FM_FORGED_GMAIL=0.622, HTML_MESSAGE=0.001, J_CHICKENPOX_26=0.6, J_CHICKENPOX_52=0.6, RP_MATCHES_RCVD=-0.547, SPF_PASS=-0.001] autolearn=no
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 FvYOpgGcSsQO for <hybi@ietfa.amsl.com>; Tue, 25 Feb 2014 14:05:24 -0800 (PST)
Received: from mail-we0-x234.google.com (mail-we0-x234.google.com [IPv6:2a00:1450:400c:c03::234]) by ietfa.amsl.com (Postfix) with ESMTP id A2E5F1A07C9 for <hybi@ietf.org>; Tue, 25 Feb 2014 14:05:23 -0800 (PST)
Received: by mail-we0-f180.google.com with SMTP id u57so959176wes.39 for <hybi@ietf.org>; Tue, 25 Feb 2014 14:05:22 -0800 (PST)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20120113; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :cc:content-type; bh=66zdOwURItyDJqQ5+W+vuQ8O8WFy428OvtMHvHZyhAM=; b=eV5dAOISFAHT+sWS6lE60ThMwMW5zBqY1rocA5vYLkJ6G8lBPkLWvj/8x0ms3BDtIc G57JQsuHcYt/rDsnLVbhDpPNjwdGCbl5LERby5tA8N2IWiFfuGo+1ronOoWtYt3iBMuG WTmJaFXSQJ7PeuKCEIVAcHR1C8OA2H1/mou2sXSMMmqYnfBwjIGsgKqk1TJTjAAZs4eB 0vZ2vhE0iwrKtIYnyqjHAwxoQ1WSVHNG/0Rhk0C8OR6XGX8960r5yZs8Fbw8YEPMVC0i wySJTvNzlG7gXuI/yerlyAw2pBhwuEc18+ZxsBxmULXR8ielfxki5X/kmWHYZtRGiQLE xkxw==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:mime-version:in-reply-to:references:from:date :message-id:subject:to:cc:content-type; bh=66zdOwURItyDJqQ5+W+vuQ8O8WFy428OvtMHvHZyhAM=; b=QEQcfN2eyG4ah/osfSyOz11wlxPGSNrKO/YP7YBsVBa9KU57onOkkzfJtVQXfuzOsi xesgC/5JCOZigKMF7o77e6RALffhNw8IQjwvH1LnQyVOdIDZkIhxyrHs6OZ8mKOdFN7g XfUrPP90YKSswpNMyZqMTqeN4keFTEAcpocQOL7uc/98Kavf7I+hHt2NS9lTWqRMIvwn q4xvH3kzyyRb79f2gO6xDH3fnzznsFn1JhyWiE0BvOZ6/REc+XTSYmnBx7eHg1A8cuZF fuJ5+8xGZkHD0mBhAVdCb/3cENn7CdkIAGlmK6iRQV7i5C9vf92y1HCLvzccStmVWEoi FULg==
X-Gm-Message-State: ALoCoQmPri6x7bl8uDBwHnkePALyqO39cQmzQp9+VtBP6z/0xuZmcyWgmojsLl3t8zeHX80Ohv87PjWNv99dD+FmzoDVf2vuabEMPDxiFg/MFdKUUbG9RQi3Ejyno89caZJ5tKf6v5Yp48IudnZvGE/TFncyS8arOFL3ZNMGqiiSG3bVKd1eCEGjY2Ov3jrBo5dWKY07Ld4b
X-Received: by 10.180.19.138 with SMTP id f10mr5157011wie.11.1393365922101; Tue, 25 Feb 2014 14:05:22 -0800 (PST)
MIME-Version: 1.0
Received: by 10.194.8.231 with HTTP; Tue, 25 Feb 2014 14:05:00 -0800 (PST)
In-Reply-To: <CABihn6GC4VM2AHza-F7ML=FfHLZu7FNqx+BhbuVsfJLWk0P92w@mail.gmail.com>
References: <CAH9hSJbjQNKnZTJmBFtU8MgmnRTYjPopC4oP_78bWUGap-9CvA@mail.gmail.com> <CAH9hSJbBmvNPBSSAk-khdWXgWw0GTt0FG3KsdzYeJcfiAPDk0A@mail.gmail.com> <CAHixhFq=wfmYH8-ij_WtsQLN=NUTJwRQ=k8jCPepQDM8V8ZZYA@mail.gmail.com> <CABihn6EN7V6XEwf6NWn78orxvr3XjGHxROJC4JjQ6RYYKEeCug@mail.gmail.com> <CACuKZqHNoR5GQmWyzbXAszZCOT2P4pjSmT3SF6ZG3X7hTY=1xw@mail.gmail.com> <CABihn6GC4VM2AHza-F7ML=FfHLZu7FNqx+BhbuVsfJLWk0P92w@mail.gmail.com>
From: Takeshi Yoshino <tyoshino@google.com>
Date: Wed, 26 Feb 2014 07:05:00 +0900
Message-ID: <CAH9hSJbSfQ2Abp6oLifi0dx4TZENzm2QRn8zMQfAv=vw+H12sw@mail.gmail.com>
To: Yutaka Hirano <yhirano@chromium.org>, Ian Hickson <ian@hixie.ch>
Content-Type: multipart/alternative; boundary="bcaec53d550dd466c004f3424833"
Archived-At: http://mailarchive.ietf.org/arch/msg/hybi/-hVPKIRA8Zd_7C3w9EmS9M4akJw
Cc: "hybi@ietf.org" <hybi@ietf.org>, Peter Thorson <webmaster@zaphoyd.com>
Subject: Re: [hybi] Straw poll: Do you miss interjectable WebSocket level control frame? (was: Re: Discontinuation of mux ...)
X-BeenThere: hybi@ietf.org
X-Mailman-Version: 2.1.15
Precedence: list
List-Id: Server-Initiated HTTP <hybi.ietf.org>
List-Unsubscribe: <https://www.ietf.org/mailman/options/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, 25 Feb 2014 22:05:25 -0000

On Tue, Feb 25, 2014 at 5:27 PM, Yutaka Hirano <yhirano@chromium.org> wrote:

> Shouldn't ws.close() allow queued messages to be flushed before the
>> actual closing?
>
> It is allowed to wait until the endpoint finishes sending the message.
> Is it the desired behavior? I thought it is undesired, but I'm not
> confident now.
>

I think it's underspecified. In the WHATWG WebSocket API spec, close() is
required to "start the WebSocket closing handshake". RFC 6455 neither says
the algorithm may terminate ongoing "Send a WebSocket Message" algorithm
nor says it may not.

----

Even if we allow close to terminate ongoing send, since the sender requests
the termination explicitly and the peer replies to the close with a close
frame after understanding the ongoing send is cancelled, it's fine to call
it as clean close, I think.

There's no way in the WebSocket API to tell that the message it is
receiving has been cancelled to the script, but I don't think it's
problematic. The message sending was clearly cancelled. Both side knows
that. The receiver just won't deliver the cancelled message.

----

But I think there're also needs for graceful close, i.e. to send a message
and do closing handshake after finishing the send. If there's only method
that terminates ongoing send, the user is required to do app level
acknowledgement before calling the method.

My gut feeling is that such a cancellation should be provides as a separate
method and close() should work as a graceful close.

This needs more discussion, but I believe WebSocket users are already used
to graceful behavior.


> On Tue, Feb 25, 2014 at 2:40 PM, Zhong Yu <zhong.j.yu@gmail.com> wrote:
>
>> On Mon, Feb 24, 2014 at 10:58 PM, Yutaka Hirano <yhirano@chromium.org>
>> wrote:
>> >> * Close: Can be used to perform a "clean" close in the middle of
>> sending a
>> >> message. However, I cannot think of any applications that would
>> consider a
>> >> situation in which a in-transit message was aborted to close the
>> connection
>> >> to be a "clean close" scenario.
>> >
>> > An endpoint should be able to cancel the ongoing transmission, i.e. The
>> > close call should abort transferring very_very_long_message in the
>> following
>> > code.
>> >
>> >
>> > ws = new WebSocket(...);
>> > ws.onopen = function() {
>> >   ws.send(very_very_long_message);
>> >   ws.close();
>> > };
>>
>> Shouldn't ws.close() allow queued messages to be flushed before the
>> actual closing?
>
>