Re: abstract Unix-domain sockets
Peter Eisentraut <peter.eisentraut@2ndquadrant.com>
From: Peter Eisentraut <peter.eisentraut@2ndquadrant.com>
To: "David G. Johnston" <david.g.johnston@gmail.com>
Cc: Michael Paquier <michael@paquier.xyz>,
pgsql-hackers <pgsql-hackers@postgresql.org>
Date: 2020-11-24T15:45:11Z
Lists: pgsql-hackers
On 2020-11-23 17:00, David G. Johnston wrote: > So presently there is no functioning code to prevent two PostgreSQL > instances from using the same socket so long as they do not also use the > same data directory? We only handle the case of an unclean crash - > where the pid and socket are both left behind - having the system tell > the user to remove the pid lock file but then auto-replacing the socket > (I was conflating the behavior with the pid lock file and the socket file). > > I would expect that we handle port misconfiguration also, by not > auto-replacing the socket and instead have the existing error message > (with modified hint) remain behind. This provides behavior consistent > with TCP port binding. Or is it the case that we always attempt to bind > the TCP/IP port, regardless of the presence of a socket file, in which > case the failure for port binding does cover the socket situation as > well? If this is the case, pointing that out in [1] and a code comment, > while removing that particular error as "dead code", would work. 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. -- Peter Eisentraut 2ndQuadrant, an EDB company https://www.2ndquadrant.com/
Commits
-
Add support for abstract Unix-domain sockets
- c9f0624bc2f5 14.0 landed
-
Make error hint from bind() failure more accurate
- d5d91acdccae 14.0 landed
-
Remove obsolete ifdefs
- 555eb1a4f011 14.0 landed