Re: What is happening on buildfarm member baiji?
Tom Lane <tgl@sss.pgh.pa.us>
From: Tom Lane <tgl@sss.pgh.pa.us>
To: Dave Page <dpage@postgresql.org>
Cc: Andrew Dunstan <andrew@dunslane.net>, Magnus Hagander <magnus@hagander.net>, pgsql-hackers@postgresql.org
Date: 2007-05-14T13:41:02Z
Lists: pgsql-hackers
Dave Page <dpage@postgresql.org> writes:
> Stephen Frost wrote:
>> I'm curious as to which Unix systems allow multiple processes to listen
>> on the same port at the same time.. On Linux, and I thought on most,
>> you get an EADDRINUSE on the listen() call (which the postmaster should
>> pick up on and bomb out, which it may already).
> Linux certainly does.
Mmm, you're right, I misread the man page:
Setting the SO_REUSEADDR option allows the local socket address to be
reused in subsequent calls to bind(). This permits multiple
SOCK_STREAM sockets to be bound to the same local address, as long as
all existing sockets with the desired local address are in a connected
state before bind() is called for a new socket.
The bit about "connected state" is relevant here --- a listening socket
isn't connected. Time for more caffeine.
> Windows seems to treat SO_REUSEADDR in the same
> way as SO_REUSEPORT which just seems wrong.
Well, Microsoft getting standards wrong is no surprise. So what do we
want to do about it?
regards, tom lane