Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1sEyJv-005SNk-Js for pgsql-hackers@arkaria.postgresql.org; Wed, 05 Jun 2024 21:37:25 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.94.2) (envelope-from ) id 1sEyJu-00CDFM-Jx for pgsql-hackers@arkaria.postgresql.org; Wed, 05 Jun 2024 21:37:22 +0000 Received: from magus.postgresql.org ([2a02:c0:301:0:ffff::29]) by malur.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1sEyJu-00CDFE-AA for pgsql-hackers@lists.postgresql.org; Wed, 05 Jun 2024 21:37:22 +0000 Received: from sss.pgh.pa.us ([68.162.161.243]) by magus.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1sEyJr-000BHh-Hq for pgsql-hackers@postgresql.org; Wed, 05 Jun 2024 21:37:21 +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 455LbFh8914152; Wed, 5 Jun 2024 17:37:15 -0400 From: Tom Lane To: Andrew Dunstan cc: Alexander Lakhin , pgsql-hackers Subject: Re: ssl tests fail due to TCP port conflict In-reply-to: References: <6756fb60-aa5f-442c-90fb-5f29cd1658f0@dunslane.net> Comments: In-reply-to Andrew Dunstan message dated "Wed, 05 Jun 2024 16:49:41 -0400" MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-ID: <914150.1717623435.1@sss.pgh.pa.us> Date: Wed, 05 Jun 2024 17:37:15 -0400 Message-ID: <914151.1717623435@sss.pgh.pa.us> List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk Andrew Dunstan writes: > On 2024-06-05 We 16:00, Alexander Lakhin wrote: >> That is, psql from the test instance 001_ssltests_34 opened a >> connection to >> the test server with the client port 50072 and it made using the port by >> the server from the test instance 001_ssltests_30 impossible. > Oh. (kicks self) D'oh. > Should we really be allocating ephemeral server ports in the range > 41952..65535? Maybe we should be looking for an unallocated port > somewhere below 41952, and above, say, 32767, so we couldn't have a > client socket collision. Hmm, are there really any standards about how these port numbers are used? I wonder if we don't need to just be prepared to retry the whole thing a few times. Even if it's true that "clients" shouldn't choose ports below 41952, we still have a small chance of failure against a non-Postgres server starting up at the wrong time. regards, tom lane