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 1nII4s-0008Hu-NU for pgsql-committers@arkaria.postgresql.org; Thu, 10 Feb 2022 22:38:14 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.92) (envelope-from ) id 1nII4r-0000qd-KT for pgsql-committers@arkaria.postgresql.org; Thu, 10 Feb 2022 22:38:13 +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 1nII4r-0000qU-Di for pgsql-committers@lists.postgresql.org; Thu, 10 Feb 2022 22:38:13 +0000 Received: from out3-smtp.messagingengine.com ([66.111.4.27]) by magus.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1nII4o-0008C4-Q9 for pgsql-committers@lists.postgresql.org; Thu, 10 Feb 2022 22:38:13 +0000 Received: from compute3.internal (compute3.nyi.internal [10.202.2.43]) by mailout.nyi.internal (Postfix) with ESMTP id 9A14E5C0070; Thu, 10 Feb 2022 17:38:08 -0500 (EST) Received: from mailfrontend1 ([10.202.2.162]) by compute3.internal (MEProxy); Thu, 10 Feb 2022 17:38:08 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=anarazel.de; h= cc:cc:content-type:date:date:from:from:in-reply-to:in-reply-to :message-id:mime-version:references:reply-to:sender:subject :subject:to:to; s=fm3; bh=SD8obT2oynKNrfokvhsH6sWX24HGbR0oXi998z kB7CY=; b=Aolsxz8NVVp+QLSaP8Vo/EVLikDcVlhSBZVQh/2LRnW1foZEcliUFV AEYX8xw0kOGmng/xD7TXmNINW3zoSSLKh80DH2dz0YBqpp68iZ0El8SME+qSlmfX lykNGozpv+3344bDIdX5/1wu+r8v+2GRPl+5RYLMlODggGe0+DxIqBZwhZrww+ED Hwoa3l+e99AEjcbJ6+XHgRq2zanf1rsCDv378P+JZ/auJtuy1Ef0DnxwG8ogVHy3 7hRA5jmSKVPiapQ4O2/pYEVbCUcLW4aGFPJqXA186xEFcpD8ZyQag91Vf6fUAd5/ EomIQ4kLvSV0PWngJCHVZQeiTIypzSKw== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:cc:content-type:date:date:from:from :in-reply-to:in-reply-to:message-id:mime-version:references :reply-to:sender:subject:subject:to:to:x-me-proxy:x-me-proxy :x-me-sender:x-me-sender:x-sasl-enc; s=fm2; bh=SD8obT2oynKNrfokv hsH6sWX24HGbR0oXi998zkB7CY=; b=MQWJpmEvmkclcsRgITkmS+j46hLqPRRYO UMqzv1dL0omRG0AJbzLDDJxS0+oqVMtESlrVOEsKXPyyNRffdJVWEetsSud8eqQD L/GJ1YIvrMApndSQ6LgoJ3gXxTpNPPUjirsV1Pm2P0DvJFwX5KZGZWAINZfbRFlI sPIo69zTHu6Magt6jrP0ADngCwuS/k/td3KdOdDZUfOT6zG0lKegMBrayAKGDayL aUJu4lJFxJIqjmbRGC7qyu2NTlaX4xb/gLZERxW7PHr2E/oLTdYaOwDY97u65Bbw miz0TUL6o8NsLt9Y3HHJfzLfZJY8OzqJX2mygWzcxn762dvcePs7A== X-ME-Sender: X-ME-Received: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgedvvddriedugdduieduucetufdoteggodetrfdotf fvucfrrhhofhhilhgvmecuhfgrshhtofgrihhlpdfqfgfvpdfurfetoffkrfgpnffqhgen uceurghilhhouhhtmecufedttdenucesvcftvggtihhpihgvnhhtshculddquddttddmne cujfgurhepfffhvffukfhfgggtuggjsehttdertddttddvnecuhfhrohhmpeetnhgurhgv shcuhfhrvghunhguuceorghnughrvghssegrnhgrrhgriigvlhdruggvqeenucggtffrrg htthgvrhhnpedukefhkeelueegveetheelffffjeegleeuudelfeefuedtleffueejfffh ueffudenucevlhhushhtvghrufhiiigvpedtnecurfgrrhgrmhepmhgrihhlfhhrohhmpe grnhgurhgvshesrghnrghrrgiivghlrdguvg X-ME-Proxy: Received: by mail.messagingengine.com (Postfix) with ESMTPA; Thu, 10 Feb 2022 17:38:08 -0500 (EST) Date: Thu, 10 Feb 2022 14:38:06 -0800 From: Andres Freund To: Tom Lane Cc: Noah Misch , Thomas Munro , pgsql-committers Subject: Re: pgsql: TAP tests: check for postmaster.pid anyway when "pg_ctl start" f Message-ID: <20220210223806.ikpf57pz2ilamqam@alap3.anarazel.de> References: <855583.1642687119@sss.pgh.pa.us> <867290.1642689136@sss.pgh.pa.us> <20220120192736.msyesvdlljn6tptw@alap3.anarazel.de> <926839.1642708567@sss.pgh.pa.us> <1075553.1642717844@sss.pgh.pa.us> <20220210023537.GA3222837@rfd.leadboat.com> <1709793.1644523137@sss.pgh.pa.us> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <1709793.1644523137@sss.pgh.pa.us> List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk Hi, On 2022-02-10 14:58:57 -0500, Tom Lane wrote: > So it looks to me like the core problem is that pg_ctl's do_stop() > is too trusting: if it once sees the postmaster PID as alive, it > figures that's the end of the story. Agreed, that's a problem. Even if it wasn't the cause of slot tests on AIX. kill -9 can be slow on other operating systems as well. I think on linux for example it's not processed immediately if already in the middle of dumping core. > (do_restart and do_promote seem similarly naive ... and why are there so > many copies of the wait loop, anyway?) :( There's generally some confusing duplication in pg_ctl.c itself, and between pg_ctl and other programs. E.g. CreateRestrictedProcess() existing both in pg_ctl and slightly differently in restricted_token.c. Wut? Also why is restricted_token.c in common/, rather than port? > Another idea is to modify Cluster.pm's kill9 to not return until the > PID is gone according to kill(0). On the other hand, that'd mask > problems like this, so I'm not entirely enthused about changing > that end of things. Seems reasonable. Greetings, Andres Freund