Alvaro Herrera wrote:
Is it possible to make it retry in case the chosen port is busy?  I
guess a simple check should suffice, ignoring the obvious race condition
that someone uses the port after you checked it was OK.

Well, the whole point of this exercise was to avoid that. If we had a way to do a "simple check", we might as well stick to the hardcoded port and count up from that or something.

The problem with doing the checking is that you have to emulate the complete postmaster logic for port numbers, listen addresses, Unix domain socket directories, etc. That can become quite involved.

Then again, a simple way to avoid the issue altogether on platforms supporting Unix-domain sockets would be to run the test over Unix-domain sockets (which we do anyway) placed in a private directory. How about that?

--
Sent via pgsql-hackers mailing list (pgsql-hackers@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-hackers

Reply via email to