Re: abstract Unix-domain sockets

From: Peter Eisentraut <peter(dot)eisentraut(at)2ndquadrant(dot)com>
To: Michael Paquier <michael(at)paquier(dot)xyz>
Cc: pgsql-hackers <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: abstract Unix-domain sockets
Date: 2020-11-17 22:18:12
Message-ID: 9fc70922-d2b2-3408-d83a-8212894749cb@2ndquadrant.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On 2020-11-12 08:12, Michael Paquier wrote:
> On Wed, Nov 11, 2020 at 01:39:17PM +0100, Peter Eisentraut wrote:
>> Thinking about it further, I think the hint in the Unix-domain socket case
>> is bogus. A socket in the file-system namespace never reports EADDRINUSE
>> anyway, it just overwrites the file. For sockets in the abstract namespace,
>> you can get this error, but of course there is no file to remove.
>>
>> Perhaps we should change the hint in both the Unix and the IP cases to:
>>
>> "Is another postmaster already running at this address?"
>> (This also resolves the confusing reference to "port" in the Unix case.)
> Er, it is perfectly possible for two postmasters to use the same unix
> socket path, abstract or not, as long as they listen to different
> ports (all nodes in a single TAP test do that for example). So we
> should keep a reference to the port used in the log message, no?

"Port" is not a real thing for Unix-domain sockets, it's just something
we use internally and append to the socket file. The error message is
currently something like

ERROR: could not bind Unix address "/tmp/.s.PGSQL.5432": Address
already in use
HINT: Is another postmaster already running on port 5432? If not,
remove socket file "/tmp/.s.PGSQL.5432" and retry.

So the mention of the "port" doesn't really add any information here and
just introduces new terminology that isn't really relevant.

My idea is to change the message to:

ERROR: could not bind Unix address "/tmp/.s.PGSQL.5432": Address
already in use
HINT: Is another postmaster already running at this address?

--
Peter Eisentraut
2ndQuadrant, an EDB company
https://www.2ndquadrant.com/

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Jacob Champion 2020-11-18 00:31:04 Re: Zedstore - compressed in-core columnar storage
Previous Message Thomas Munro 2020-11-17 22:00:11 Re: ERROR: too many dynamic shared memory segment