Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1lYeAL-0004h8-4i for pgsql-hackers@arkaria.postgresql.org; Tue, 20 Apr 2021 00:22:57 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.92) (envelope-from ) id 1lYeAJ-0007PN-P2 for pgsql-hackers@arkaria.postgresql.org; Tue, 20 Apr 2021 00:22:55 +0000 Received: from makus.postgresql.org ([2001:4800:3e1:1::229]) by malur.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1lYeAJ-0007H1-ID for pgsql-hackers@lists.postgresql.org; Tue, 20 Apr 2021 00:22:55 +0000 Received: from sss.pgh.pa.us ([66.207.139.130]) by makus.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1lYdE9-0008Nl-1P for pgsql-hackers@lists.postgresql.org; Mon, 19 Apr 2021 23:22:54 +0000 Received: from sss1.sss.pgh.pa.us (localhost [127.0.0.1]) by sss.pgh.pa.us (8.15.2/8.15.2) with ESMTP id 13JNMlYw459596; Mon, 19 Apr 2021 19:22:47 -0400 From: Tom Lane To: Alexey Kondratov cc: pgsql-hackers@lists.postgresql.org Subject: Re: Free port choosing freezes when PostgresNode::use_tcp is used on BSD systems In-reply-to: <82e271a9a11928337fcb5b5e57b423c0@postgrespro.ru> References: <20210127213658.GA736@alvherre.pgsql> <55c6c1526b94d2caf54c33262fe00674@postgrespro.ru> <1c506564e2a732ec17790bd8c34f042e@postgrespro.ru> <66bad38beb87fb32952d89602e467444@postgrespro.ru> <82e271a9a11928337fcb5b5e57b423c0@postgrespro.ru> Comments: In-reply-to Alexey Kondratov message dated "Tue, 20 Apr 2021 01:22:41 +0300" MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-ID: <459594.1618874567.1@sss.pgh.pa.us> Date: Mon, 19 Apr 2021 19:22:47 -0400 Message-ID: <459595.1618874567@sss.pgh.pa.us> List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk Alexey Kondratov 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