Re: [hybi] Additional WebSocket Close Error Codes

Jamie Lokier <> Thu, 07 June 2012 02:39 UTC

Return-Path: <>
Received: from localhost (localhost []) by (Postfix) with ESMTP id 9D96111E80D6 for <>; Wed, 6 Jun 2012 19:39:20 -0700 (PDT)
X-Virus-Scanned: amavisd-new at
X-Spam-Flag: NO
X-Spam-Score: -2.599
X-Spam-Status: No, score=-2.599 tagged_above=-999 required=5 tests=[BAYES_00=-2.599]
Received: from ([]) by localhost ( []) (amavisd-new, port 10024) with ESMTP id 00LZ16ecM7ln for <>; Wed, 6 Jun 2012 19:39:20 -0700 (PDT)
Received: from ( []) by (Postfix) with ESMTP id 0193811E80C1 for <>; Wed, 6 Jun 2012 19:39:20 -0700 (PDT)
Received: from jamie by with local (Exim 4.63) (envelope-from <>) id 1ScSd4-0001dt-MS; Thu, 07 Jun 2012 03:39:18 +0100
Date: Thu, 07 Jun 2012 03:39:18 +0100
From: Jamie Lokier <>
To: Alexey Melnikov <>
Message-ID: <>
References: <>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Disposition: inline
In-Reply-To: <>
User-Agent: Mutt/1.5.21 (2010-09-15)
Cc: Hybi <>
Subject: Re: [hybi] Additional WebSocket Close Error Codes
X-Mailman-Version: 2.1.12
Precedence: list
List-Id: Server-Initiated HTTP <>
List-Unsubscribe: <>, <>
List-Archive: <>
List-Post: <>
List-Help: <>
List-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
> <>):
> 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