Re: [hybi] WS close code equivalent to HTTP 500/Internal Server Error

Salvatore Loreto <salvatore.loreto@ericsson.com> Wed, 30 November 2011 06:41 UTC

Return-Path: <salvatore.loreto@ericsson.com>
X-Original-To: hybi@ietfa.amsl.com
Delivered-To: hybi@ietfa.amsl.com
Received: from localhost (localhost [127.0.0.1]) by ietfa.amsl.com (Postfix) with ESMTP id 24B7821F854E for <hybi@ietfa.amsl.com>; Tue, 29 Nov 2011 22:41:19 -0800 (PST)
X-Virus-Scanned: amavisd-new at amsl.com
X-Spam-Flag: NO
X-Spam-Score: -106.599
X-Spam-Level:
X-Spam-Status: No, score=-106.599 tagged_above=-999 required=5 tests=[BAYES_00=-2.599, RCVD_IN_DNSWL_MED=-4, USER_IN_WHITELIST=-100]
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 QqaU1Wvo+weD for <hybi@ietfa.amsl.com>; Tue, 29 Nov 2011 22:41:16 -0800 (PST)
Received: from mailgw10.se.ericsson.net (mailgw10.se.ericsson.net [193.180.251.61]) by ietfa.amsl.com (Postfix) with ESMTP id B331B21F8492 for <hybi@ietf.org>; Tue, 29 Nov 2011 22:41:15 -0800 (PST)
X-AuditID: c1b4fb3d-b7b5fae00000219a-66-4ed5d00a2585
Received: from esessmw0237.eemea.ericsson.se (Unknown_Domain [153.88.253.125]) by mailgw10.se.ericsson.net (Symantec Mail Security) with SMTP id E9.99.08602.A00D5DE4; Wed, 30 Nov 2011 07:41:14 +0100 (CET)
Received: from mail.lmf.ericsson.se (153.88.115.8) by esessmw0237.eemea.ericsson.se (153.88.115.91) with Microsoft SMTP Server id 8.3.137.0; Wed, 30 Nov 2011 07:41:14 +0100
Received: from nomadiclab.lmf.ericsson.se (nomadiclab.lmf.ericsson.se [131.160.33.3]) by mail.lmf.ericsson.se (Postfix) with ESMTP id 00DF7231B for <hybi@ietf.org>; Wed, 30 Nov 2011 08:41:14 +0200 (EET)
Received: from nomadiclab.lmf.ericsson.se (localhost [127.0.0.1]) by nomadiclab.lmf.ericsson.se (Postfix) with ESMTP id B8E9251B2E for <hybi@ietf.org>; Wed, 30 Nov 2011 08:41:13 +0200 (EET)
Received: from Salvatore-Loretos-MacBook-Pro.local (localhost [127.0.0.1]) by nomadiclab.lmf.ericsson.se (Postfix) with ESMTP id 4865E515DF for <hybi@ietf.org>; Wed, 30 Nov 2011 08:41:13 +0200 (EET)
Message-ID: <4ED5D00D.1020600@ericsson.com>
Date: Wed, 30 Nov 2011 07:41:17 +0100
From: Salvatore Loreto <salvatore.loreto@ericsson.com>
User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.6; rv:8.0) Gecko/20111105 Thunderbird/8.0
MIME-Version: 1.0
To: hybi@ietf.org
References: <02F41063-6221-4EB8-A4E4-2E396A6B946C@zaphoyd.com> <4ED4E9CB.3040106@isode.com>
In-Reply-To: <4ED4E9CB.3040106@isode.com>
Content-Type: text/plain; charset="ISO-8859-1"; format="flowed"
Content-Transfer-Encoding: 7bit
X-Virus-Scanned: ClamAV using ClamSMTP
X-Brightmail-Tracker: AAAAAA==
Subject: Re: [hybi] WS close code equivalent to HTTP 500/Internal Server Error
X-BeenThere: hybi@ietf.org
X-Mailman-Version: 2.1.12
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: Wed, 30 Nov 2011 06:41:19 -0000

wfm

/Sal

On 11/29/11 3:18 PM, Alexey Melnikov wrote:
> Peter Thorson wrote:
>> This issue came up while polishing up the error handling code for my WS implementation. There doesn't seem to be a websocket close code equivalent to HTTP 500/Internal server error.
>>
>> I would like to handle situations where my endpoint catches an internal logic error and knows that continuing the connection will probably result in bad/unknown behavior but knows that it is safe enough to close the connection cleanly.
>>
>> Example: I am a server and my handler for processing websocket messages is interpreted code and that code has a syntax error. The websocket server itself is fine and can safely close the connection but clearly cannot process messages until someone fixes the missing semicolon somewhere. In an HTTP server I would return 500/Internal Server error to indicate that something on the server end screwed up and that there is probably more information in the server log files to diagnose further.
>>
>> None of the current close codes (except 1006/abnormal closure - which isn't allowed on the wire) really fit. I'd rather not just drop the connection uncleanly/send back empty close frame since that provides no information about what happened and makes figuring out whose logs I should be looking at as an end application developer difficult. Browsers only report the status code itself and not the reason so sending a normal/going away error code with a more specific reason is less helpful. What are other implementations doing in this case? Would another close code for internal server error make sense?
> Let's use 1011 for this (Unless I already suggested it be used for
> something else. Please correct me if I did.):
>
> 1011
>         1011 indicates that a server is terminating the connection
>         because it has encountered an unexpected condition which prevented
>         it from fulfilling the request.
>
> _______________________________________________
> hybi mailing list
> hybi@ietf.org
> https://www.ietf.org/mailman/listinfo/hybi
>