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 1oyuUR-0005Ck-U2 for pgsql-committers@arkaria.postgresql.org; Sat, 26 Nov 2022 12:41:03 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.92) (envelope-from ) id 1oyuUP-0005pm-90 for pgsql-committers@arkaria.postgresql.org; Sat, 26 Nov 2022 12:41:01 +0000 Received: from magus.postgresql.org ([2a02:c0:301:0:ffff::29]) by malur.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1oyuUP-0005pb-2H for pgsql-committers@lists.postgresql.org; Sat, 26 Nov 2022 12:41:01 +0000 Received: from relay1-d.mail.gandi.net ([2001:4b98:dc4:8::221]) by magus.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1oyuUM-0004OK-7v for pgsql-committers@lists.postgresql.org; Sat, 26 Nov 2022 12:41:00 +0000 Received: (Authenticated sender: adsend@dunslane.net) by mail.gandi.net (Postfix) with ESMTPSA id 0C365240008; Sat, 26 Nov 2022 12:40:53 +0000 (UTC) Message-ID: <9b877a84-852f-8ccb-c9ba-72cb01dff266@dunslane.net> Date: Sat, 26 Nov 2022 07:40:52 -0500 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:91.0) Gecko/20100101 Thunderbird/91.5.0 Subject: Re: pgsql: Prevent port collisions between concurrent TAP tests Content-Language: en-US To: Michael Paquier Cc: pgsql-committers@lists.postgresql.org References: From: Andrew Dunstan In-Reply-To: Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk On 2022-11-26 Sa 06:15, Michael Paquier wrote: > Hi Andrew, > > On Tue, Nov 22, 2022 at 03:56:43PM +0000, Andrew Dunstan wrote: >> Prevent port collisions between concurrent TAP tests >> >> Currently there is a race condition where if concurrent TAP tests both >> test that they can open a port they will assume that it is free and use >> it, causing one of them to fail. To prevent this we record a reservation >> using an exclusive lock, and any TAP test that discovers a reservation >> checks to see if the reserving process is still alive, and looks for >> another free port if it is. >> >> Ports are reserved in a directory set by the environment setting >> PG_TEST_PORT_DIR, or if that doesn't exist a subdirectory of the top >> build directory as set by Makefile.global, or its own >> tmp_check directory. > Wouldn't it be better to update .gitgnore at the root of the source > folder to discard portlock/ so as we will never include by accident in > a commit? > Yes, good point. Will do. cheers andrew -- Andrew Dunstan EDB: https://www.enterprisedb.com