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 1nAYUA-0005EP-9S for pgsql-committers@arkaria.postgresql.org; Thu, 20 Jan 2022 14:32:22 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.92) (envelope-from ) id 1nAYU9-0003tD-2Z for pgsql-committers@arkaria.postgresql.org; Thu, 20 Jan 2022 14:32:21 +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 1nAYU8-0003sz-RX for pgsql-committers@lists.postgresql.org; Thu, 20 Jan 2022 14:32:20 +0000 Received: from sss.pgh.pa.us ([66.207.139.130]) by magus.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1nAYU6-0004zL-PJ for pgsql-committers@lists.postgresql.org; Thu, 20 Jan 2022 14:32:20 +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 20KEWGlN867291; Thu, 20 Jan 2022 09:32:16 -0500 From: Tom Lane To: Thomas Munro cc: pgsql-committers Subject: Re: pgsql: TAP tests: check for postmaster.pid anyway when "pg_ctl start" f In-reply-to: <855583.1642687119@sss.pgh.pa.us> References: <855583.1642687119@sss.pgh.pa.us> Comments: In-reply-to Tom Lane message dated "Thu, 20 Jan 2022 08:58:39 -0500" MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-ID: <867289.1642689136.1@sss.pgh.pa.us> Date: Thu, 20 Jan 2022 09:32:16 -0500 Message-ID: <867290.1642689136@sss.pgh.pa.us> List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk I wrote: > Hmm. I think the problem is that poll_start() thinks it can just call > start() a second time after a failure. If it wasn't a true failure > but a timeout, then _pid is now set and the second call complains. Oh, wait --- the case that is failing is after 017_shm.pl has intentionally kill -9'd a postmaster, so that its pidfile is left behind. The next attempted start fails on shmem id conflict, but it doesn't remove the old pidfile, and then the code I added to sub start erroneously picks that up as a live postmaster PID. Seems like we need to do 'kill 0' on the PID we get from the file to verify that there's really a postmaster there. (I wonder how well that works on Windows? perlport claims it does, but ...) I fear I still don't have the whole story though because per this theory it should fail everywhere, yet it doesn't. regards, tom lane