Re: abstract Unix-domain sockets

From: Peter Eisentraut <peter(dot)eisentraut(at)2ndquadrant(dot)com>
To: "David G(dot) Johnston" <david(dot)g(dot)johnston(at)gmail(dot)com>
Cc: Michael Paquier <michael(at)paquier(dot)xyz>, pgsql-hackers <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: abstract Unix-domain sockets
Date: 2020-11-25 07:49:26
Message-ID: a6173454-b5d3-c608-4f53-4888b969f446@2ndquadrant.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On 2020-11-24 16:49, David G. Johnston wrote:
> On Tue, Nov 24, 2020 at 8:45 AM Peter Eisentraut
> <peter(dot)eisentraut(at)2ndquadrant(dot)com
> <mailto:peter(dot)eisentraut(at)2ndquadrant(dot)com>> wrote:
>
> We're subject to whatever the kernel behavior is.  If the kernel
> doesn't
> report address conflicts for Unix-domain sockets, then we can't do
> anything about that.  Having an error message ready in case the kernel
> does report such an error is not useful if it never does.
>
>
> It's a file, we can check for its existence in user-space.

But not without race conditions. That's why we have the separate lock
file, so we can do this properly.

Also, even if one were to add code to check the file existence first,
this would be separate code and would not affect the behavior of the
bind() call that we are discussing here.

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

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message Fujii Masao 2020-11-25 08:07:48 Re: [PATCH] Add features to pg_stat_statements
Previous Message Peter Eisentraut 2020-11-25 07:47:09 Re: abstract Unix-domain sockets