Re: Free port choosing freezes when PostgresNode::use_tcp is used on BSD systems - Mailing list pgsql-hackers

From Tom Lane
Subject Re: Free port choosing freezes when PostgresNode::use_tcp is used on BSD systems
Date
Msg-id 459595.1618874567@sss.pgh.pa.us
Whole thread Raw
In response to Free port choosing freezes when PostgresNode::use_tcp is used on BSD systems  (Alexey Kondratov <a.kondratov@postgrespro.ru>)
Responses Re: Free port choosing freezes when PostgresNode::use_tcp is used on BSD systems  (Andrew Dunstan <andrew@dunslane.net>)
List pgsql-hackers
Alexey Kondratov <a.kondratov@postgrespro.ru> writes:
> And this is an absolute true, on BSD-like systems (macOS and FreeBSD 
> tested) it hangs on looping through the entire ports range over and over 
> when $PostgresNode::use_tcp = 1 is set, since bind fails with:

Hm.

> That way, if it really could happen why not to just skip binding to 
> 127.0.0/24 addresses other than 127.0.0.1 outside of Linux/Windows as 
> per attached patch_PostgresNode.diff?

That patch seems wrong, or at least it's ignoring the advice immediately
above about binding to 0.0.0.0 only on Windows.

I wonder whether we could get away with just replacing the $use_tcp
test with $TestLib::windows_os.  It's not really apparent to me
why we should care about 127.0.0.not-1 on Unix-oid systems.

            regards, tom lane



pgsql-hackers by date:

Previous
From: Alvaro Herrera
Date:
Subject: Re: when the startup process doesn't
Next
From: Thomas Munro
Date:
Subject: Re: Bogus collation version recording in recordMultipleDependencies