Re: Why doesn't src/backend/port/win32/socket.c implement bind()?

From: Michael Paquier <michael(dot)paquier(at)gmail(dot)com>
To: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
Cc: Magnus Hagander <magnus(at)hagander(dot)net>, Amit Kapila <amit(dot)kapila16(at)gmail(dot)com>, pgsql-hackers <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: Why doesn't src/backend/port/win32/socket.c implement bind()?
Date: 2016-04-13 12:20:57
Message-ID: CAB7nPqRYPvYW9deTciZvSxMxiZ=Lp407_tEjZR6aQS4XVLbU+A@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On Wed, Apr 13, 2016 at 9:06 AM, Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us> wrote:
> While we wait to see if that actually helps give useful errors,
> I had a thought about what may be happening here. PostgresNode.pm
> picks a random high port number and tests to see if it's free using
> pg_isready, with (unless I'm misreading) any non-zero result code
> being taken as "it's free". The problem here is that that completely
> fails to recognize a port being used by a non-Postgres process as
> not-free --- most likely, you'll get PQPING_NO_RESPONSE for that case.
> If there's other stuff using high ports on a particular buildfarm machine,
> you'd expect occasional random test failures due to this. The observed
> fact that some buildfarm critters are much more prone to this type of
> failure than others is well explained by this hypothesis.

Each test run uses its own custom unix_socket_directories, PGHOST is
enforced to use it, and all the port tests go through that as well.
And it seems to me that the same port number can be used as long as
the socket directory is different, no? At least that's how
PostgresNode has been designed to work, and this is useful when
running tests in parallel to avoid port and host collision.
--
Michael

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Michael Paquier 2016-04-13 12:21:29 Re: Missing PG_INT32_MIN in numutils.c
Previous Message Robert Haas 2016-04-13 11:57:09 Re: Missing PG_INT32_MIN in numutils.c