pgsql: Try harder to detect a port conflict in PostgresNode.pm.

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: pgsql-committers(at)postgresql(dot)org
Subject: pgsql: Try harder to detect a port conflict in PostgresNode.pm.
Date: 2016-04-25 16:28:55
Message-ID: E1aujNX-0007N5-MY@gemulon.postgresql.org
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-committers

Try harder to detect a port conflict in PostgresNode.pm.

Commit fab84c7787f25756 tried to get away without doing an actual bind(),
but buildfarm results show that that doesn't get the job done. So we must
really bind to the target port --- and at least on my Linux box, we need a
listen() as well, or conflicts won't be detected. We rely on SO_REUSEADDR
to prevent problems from starting a postmaster on the socket immediately
after we've bound to it in the test code. (There may be platforms where
that doesn't work too well. But fortunately, we only really care whether
this works on Windows, and there the default behavior should be OK.)

Branch
------
master

Details
-------
http://git.postgresql.org/pg/commitdiff/40e89e2ab89cb2801f6bc02f08dcc24d547530fc

Modified Files
--------------
src/test/perl/PostgresNode.pm | 18 ++++++++++++------
1 file changed, 12 insertions(+), 6 deletions(-)

Browse pgsql-committers by date

  From Date Subject
Next Message Tom Lane 2016-04-25 19:09:39 Re: [COMMITTERS] pgsql: Add trigonometric functions that work in degrees.
Previous Message Robert Haas 2016-04-25 13:46:38 Re: [COMMITTERS] pgsql: Convert the PGPROC->lwWaitLink list into a dlist instead of open