Subject: Re: Seamless Service Restart / Port Takeover

From: Rick Jones <[email-masked]>
Date: Wed, 12 Oct 2011 10:14:00 -0700

On 10/12/2011 09:53 AM, Olaf van der Spek wrote:
> Hi,
>
> When restarting a service, a webserver for example, you'd like this to
> be seamless for clients. Often, first a signal is send to the old
> process to close listening sockets, then the new process is started.
> This has both a race condition (sometimes 'avoided' with a sleep in
> between) and service interruption.
> Wouldn't it be possible to introduce mv / move like behaviour, where
> the socket can be rebound without races and without interruption?

I believe you can do that today if you write the application such that 
the old instance, before it closes the listen endpoint and terminates, 
instead passes access to it to the new instance via a Unix domain socket 
between the two.

rick jones