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

"Arman Djusupov" <arman@noemax.com> Wed, 09 May 2012 09:08 UTC

Return-Path: <arman@noemax.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 7872A21F85B4 for <hybi@ietfa.amsl.com>; Wed, 9 May 2012 02:08:33 -0700 (PDT)
X-Virus-Scanned: amavisd-new at amsl.com
X-Spam-Flag: NO
X-Spam-Score: -2.412
X-Spam-Level:
X-Spam-Status: No, score=-2.412 tagged_above=-999 required=5 tests=[AWL=0.186, BAYES_00=-2.599, MISSING_MIMEOLE=0.001]
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 BqzREdkZDOzv for <hybi@ietfa.amsl.com>; Wed, 9 May 2012 02:08:32 -0700 (PDT)
Received: from mail.noemax.com (mail.noemax.com [64.34.201.8]) by ietfa.amsl.com (Postfix) with ESMTP id 2723D21F85A8 for <hybi@ietf.org>; Wed, 9 May 2012 02:08:29 -0700 (PDT)
DKIM-Signature: a=rsa-sha1; t=1336554505; x=1337159305; s=m1024; d=noemax.com; c=relaxed/relaxed; v=1; bh=Y+G+pFE3hAH7l0fz6+znmNGm46I=; h=From:Subject:Date:Message-ID:To:Cc:MIME-Version:Content-Type:Content-Transfer-Encoding:In-Reply-To:References; b=zLkvzCs5lHSX28UVgTxhUrATmZ/WEXFes6RVianlrTeWDuUYNl3aj277hS/5Lu1EF8eG2wze+GIx4iAT1F6XAbRh3MfyVZmXERI2hok02tFvuoE7Szq5m1tiEsjNYvtcA32tuhAUGdlUUjZoSWbbOTT2RkWDUSYW7QypSeRyTok=
Received: from mail.noemax.com by mail.noemax.com (IceWarp 10.4.0) with ASMTP (SSL) id TOR30124; Wed, 09 May 2012 12:08:24 +0300
From: Arman Djusupov <arman@noemax.com>
To: 'Takashi Toyoshima' <toyoshim@chromium.org>, 'Alexey Melnikov' <alexey.melnikov@isode.com>
References: <02F41063-6221-4EB8-A4E4-2E396A6B946C@zaphoyd.com> <4ED4E9CB.3040106@isode.com> <CAFWCB1mM=276jZGTmgRTDrd=i=m7B=VF8JG0hwUcO0Qor4pJoA@mail.gmail.com>
In-Reply-To: <CAFWCB1mM=276jZGTmgRTDrd=i=m7B=VF8JG0hwUcO0Qor4pJoA@mail.gmail.com>
Date: Wed, 09 May 2012 12:08:12 +0300
Message-ID: <000001cd2dc3$47206370$d5612a50$@noemax.com>
MIME-Version: 1.0
Content-Type: text/plain; charset="iso-8859-1"
Content-Transfer-Encoding: quoted-printable
X-Priority: 1 (Highest)
X-MSMail-Priority: High
X-Mailer: Microsoft Outlook 14.0
Importance: High
Thread-Index: AQIc7uc3s94HhOFEXTbWy+U/mTL0ywGYB2NHAu5V0q6V/XUnoA==
Content-Language: en-us
Cc: hybi@ietf.org, 'Peter Thorson' <webmaster@zaphoyd.com>
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, 09 May 2012 09:08:33 -0000

Since WS is a duplex transport it should not differentiate the client from
the server except during the handshake phase. I think we should assume that
in this context the server is not meant to be the side that accepts a
connection but the side that processes the message. It should be correct to
use 1011 both on the server and on the client side. For this reason the
specification might need a change in the error code name and description;
suggestion:


>From : "Internal Server Error" To: "Internal Error"

Description, from :
     "1011 indicates that a server is terminating the connection because
       it encountered an unexpected condition that prevented it from
       fulfilling the request."
To:
     "1011 indicates that a remote endpoint is terminating the connection
      because it encountered an unexpected condition that prevented it
      from fulfilling the request."
 
With best regards,
Arman

-----Original Message-----
From: hybi-bounces@ietf.org [mailto:hybi-bounces@ietf.org] On Behalf Of
Takashi Toyoshima
Sent: Wednesday, May 09, 2012 7:03 AM
To: Alexey Melnikov
Cc: hybi@ietf.org; Peter Thorson
Subject: Re: [hybi] WS close code equivalent to HTTP 500/Internal Server
Error

Hi hybi,

Is this discussion valid also for browser side implementation?
My concern is that what error code should be sent if a browser got an
internal error.

On Tue, Nov 29, 2011 at 11:18 PM, Alexey Melnikov
<alexey.melnikov@isode.com> 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
_______________________________________________
hybi mailing list
hybi@ietf.org
https://www.ietf.org/mailman/listinfo/hybi