The SO_REUSEPORT socket option
The SO_REUSEPORT socket option
Posted Mar 14, 2013 11:34 UTC (Thu) by andresfreund (subscriber, #69562)In reply to: The SO_REUSEPORT socket option by jezuch
Parent article: The SO_REUSEPORT socket option
> My thought exactly.
One argument for SO_REUSEPORT is that it makes it easier to use independently started processes on the same socket. E.g. with it you can simply start the new server - potentially in a new version - and shutdown the old one after that, without any service interruption. At the moment you need to have a unix socket between the servers, send over the tcp socket file handle, start accept()ing in the new server and then shutdown the old one.
(Log in to post comments)
The SO_REUSEPORT socket option
Posted Jun 8, 2014 5:40 UTC (Sun) by wahern (subscriber, #37304) [Link]
So, no, this doesn't support seamless server restarts.
Ironically it's the BSD semantics which support seamless server restarts. In my tests OS X's behavior (which I presume is identical to FreeBSD and other BSDs) is that the last socket to bind is the only one to receive new connections. That allows the old server to drain its queue and retire without worrying about any dropped connections.