From: | Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us> |
---|---|
To: | Magnus Hagander <magnus(at)hagander(dot)net> |
Cc: | Andrew Dunstan <andrew(at)dunslane(dot)net>, Dave Page <dpage(at)postgresql(dot)org>, pgsql-hackers(at)postgresql(dot)org |
Subject: | Re: What is happening on buildfarm member baiji? |
Date: | 2007-05-14 15:28:40 |
Message-ID: | 12053.1179156520@sss.pgh.pa.us |
Views: | Raw Message | Whole Thread | Download mbox | Resend email |
Thread: | |
Lists: | pgsql-hackers |
Magnus Hagander <magnus(at)hagander(dot)net> writes:
> + sprintf(mutexName,"postgresql.interlock.%i", portNumber);
That won't do; it should be legal for two postmasters to listen on
different IP addresses using the same port number. So you need to
include some representation of the IP address being bound to.
> + if (GetLastError() == ERROR_ALREADY_EXISTS)
> + ereport(FATAL,
> + (errcode(ERRCODE_LOCK_FILE_EXISTS),
> + errmsg("interlock mutex \"%s\" already exists", mutexName),
> + errhint("Is another postgres listening on port %i", portNumber)));
ereport(FATAL) is quite inappropriate here. Do the same thing that
bind() failure would do, ie, ereport(LOG) and continue the loop.
Also, you probably need to think about cleaning up the mutex in
case one of the later steps of socket-acquisition fails. We should
only be holding locks on addresses we've successfully bound.
regards, tom lane
From | Date | Subject | |
---|---|---|---|
Next Message | Gregory Stark | 2007-05-14 15:38:24 | Re: What is happening on buildfarm member baiji? |
Previous Message | Tom Lane | 2007-05-14 15:03:52 | Re: Concurrent psql patch |