Re: [hybi] Additional WebSocket Close Error Codes

Jamie Lokier <jamie@shareable.org> Thu, 07 June 2012 02:39 UTC

Return-Path: <jamie@shareable.org>
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 9D96111E80D6 for <hybi@ietfa.amsl.com>; Wed, 6 Jun 2012 19:39:20 -0700 (PDT)
X-Virus-Scanned: amavisd-new at amsl.com
X-Spam-Flag: NO
X-Spam-Score: -2.599
X-Spam-Level:
X-Spam-Status: No, score=-2.599 tagged_above=-999 required=5 tests=[BAYES_00=-2.599]
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 00LZ16ecM7ln for <hybi@ietfa.amsl.com>; Wed, 6 Jun 2012 19:39:20 -0700 (PDT)
Received: from mail2.shareable.org (mail2.shareable.org [80.68.89.115]) by ietfa.amsl.com (Postfix) with ESMTP id 0193811E80C1 for <hybi@ietf.org>; Wed, 6 Jun 2012 19:39:20 -0700 (PDT)
Received: from jamie by mail2.shareable.org with local (Exim 4.63) (envelope-from <jamie@shareable.org>) id 1ScSd4-0001dt-MS; Thu, 07 Jun 2012 03:39:18 +0100
Date: Thu, 7 Jun 2012 03:39:18 +0100
From: Jamie Lokier <jamie@shareable.org>
To: Alexey Melnikov <alexey.melnikov@isode.com>
Message-ID: <20120607023918.GC26406@jl-vm1.vm.bytemark.co.uk>
References: <4FB3765D.5060308@isode.com>
MIME-Version: 1.0
Content-Type: text/plain; charset=us-ascii
Content-Disposition: inline
In-Reply-To: <4FB3765D.5060308@isode.com>
User-Agent: Mutt/1.5.21 (2010-09-15)
Cc: Hybi <hybi@ietf.org>
Subject: Re: [hybi] Additional WebSocket Close Error Codes
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: Thu, 07 Jun 2012 02:39:20 -0000

Alexey Melnikov wrote:
> Hi WG,
> I am sorry I didn't followup on this when the following 2 codes were
> suggested (See
> <http://www.ietf.org/mail-archive/web/hybi/current/msg09284.html>):
> 
> 1012/Service Restart
> 1012 indicates that the service is restarted. a client may
> reconnect, and if it choses to do, should reconnect using a
> randomized delay of 5 - 30s.
> 
> Use case:
> restart a service with 100k clients connected
> clients present an informative user notification ("service
> restarting .. reconnecting in N secs)
> clients should not reconnect all at exactly the same time .. thus
> the randomized delay

On the other hand, if you have almost real-time requirements and you
simply restarted a service, sometimes 5-30s is uncomfortable long.
For some applications it means the client is effectively frozen for
5-30s.  Sometimes, you want restarting the service to be as invisible
to the user as reasonably possible.

Your server knows the current load, so has an idea if it could handle
immediate or faster reconnection attempts.  On an intranet, you might
want it randomised as 0-1s for 10k clients.

Any reason you chose this length of time?  Could a suggested delay be
included with the error, with 5-30s being the default?

> 1013/Service Overload
> 1013 indicates that the service is experiencing overload. a client
> should only connect to a different IP (when there are multiple for
> the target) or reconnect to the same IP upon user action.

Maybe it could suggest which different IP(s) (and/or URL(s))?

-- Jamie