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.96) (envelope-from ) id 1w5Dyx-0031rX-0M for pgsql-hackers@arkaria.postgresql.org; Wed, 25 Mar 2026 02:28:31 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.96) (envelope-from ) id 1w5Dyu-00AcTA-2Q for pgsql-hackers@arkaria.postgresql.org; Wed, 25 Mar 2026 02:28:29 +0000 Received: from makus.postgresql.org ([2001:4800:3e1:1::229]) by malur.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.96) (envelope-from ) id 1w5Dyu-00AcSy-1V for pgsql-hackers@lists.postgresql.org; Wed, 25 Mar 2026 02:28:28 +0000 Received: from fhigh-a5-smtp.messagingengine.com ([103.168.172.156]) by makus.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.98.2) (envelope-from ) id 1w5Dyp-00000000tHs-0FlQ for pgsql-hackers@postgresql.org; Wed, 25 Mar 2026 02:28:28 +0000 Received: from phl-compute-06.internal (phl-compute-06.internal [10.202.2.46]) by mailfhigh.phl.internal (Postfix) with ESMTP id 8335E14001DF; Tue, 24 Mar 2026 22:28:22 -0400 (EDT) Received: from phl-frontend-03 ([10.202.2.162]) by phl-compute-06.internal (MEProxy); Tue, 24 Mar 2026 22:28:22 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=paquier.xyz; h= cc:cc:content-type:content-type:date:date:from:from:in-reply-to :in-reply-to:message-id:mime-version:references:reply-to:subject :subject:to:to; s=fm1; t=1774405702; x=1774492102; bh=GgLPgj//lF 3o6muEzl2i3wu5zjhCJAOMfS80oSRZ+Nc=; b=BO6eWR2nV/OykvpBexmGonC0oL DPIFBDP4nNmGqPh738jhk1KWrIoEAxgc85Z3nBJGluSbSa1pM+7kLp1nJHqtLMTR 74NT/SBgrke5I2euT8MDwkxkiUJ6iU3EtUO6kie9DFQkty8Na/HgWkDiRr5j69MF tZS+ow/0bcl8E8ggzG0oyXWFPsyvQJ5JfEJxJxl3+hMpZDIOPcqbo5JZWksH4oow iJQbV084IzkO7QhqkJfiwCP02FXkuAqKduFYWMNoTNMGIfCmxaneAGjnkPtfOY3I 8w8GbYY7Ty2mvyUuUSy3QRuVExkpmcHnMlUaXs/1I19Z3zSvNp/Th0ZM+Ing== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:cc:content-type:content-type:date:date :feedback-id:feedback-id:from:from:in-reply-to:in-reply-to :message-id:mime-version:references:reply-to:subject:subject:to :to:x-me-proxy:x-me-sender:x-me-sender:x-sasl-enc; s=fm1; t= 1774405702; x=1774492102; bh=GgLPgj//lF3o6muEzl2i3wu5zjhCJAOMfS8 0oSRZ+Nc=; b=baG2Yy06S7Ou/pM2Ip91+Ds6E5/1nQo7yieJ/aGl1Rz6q9zlRQN 6Jo2GJ7PYHx82ch3ZBF9E4WTtyZOPF4OEwY8VVe4f7wB7Tm3SUB8CYEuQttABjq6 nU1mHatpcQk5amc2EbZRIFrScmBFwSmSo+60OShyx3OssdTlTDdpyohxnloPFsXn JuLfgsN28me67Ur2WkgLDvQvJp77fOo+X8AuKnN8K687jDyLghWCd3SQvTmaey3L lkdRM3GQXSD1Z+IxqJhw0WRPawqB9yC/P9vu8Vn7vnxvuT79Od1zTHYseZuv7gWw VquGDqq4uomDz+VSYjyiXRdWv0gGClUPOVw== X-ME-Sender: X-ME-Received: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgeefgedrtddtgdefvdefvdeiucetufdoteggodetrf dotffvucfrrhhofhhilhgvmecuhfgrshhtofgrihhlpdfurfetoffkrfgpnffqhgenuceu rghilhhouhhtmecufedttdenucesvcftvggtihhpihgvnhhtshculddquddttddmnegfrh hlucfvnfffucdljedtmdenucfjughrpeffhffvvefukfhfgggtuggjsehgtderredttddv necuhfhrohhmpefoihgthhgrvghlucfrrghquhhivghruceomhhitghhrggvlhesphgrqh huihgvrhdrgiihiieqnecuggftrfgrthhtvghrnhepteelieefudffhffhtdetleeggeeg fffhkeeuveetiefgudduvedutefggeeivdejnecuvehluhhsthgvrhfuihiivgeptdenuc frrghrrghmpehmrghilhhfrhhomhepmhhitghhrggvlhesphgrqhhuihgvrhdrgiihiidp nhgspghrtghpthhtohepvddpmhhouggvpehsmhhtphhouhhtpdhrtghpthhtoheprhhosg gvrhhtphgrnhhgsehgohhoghhlvgdrtghomhdprhgtphhtthhopehpghhsqhhlqdhhrggt khgvrhhssehpohhsthhgrhgvshhqlhdrohhrgh X-ME-Proxy: Feedback-ID: i0fe9450f:Fastmail Received: by mail.messagingengine.com (Postfix) with ESMTPA; Tue, 24 Mar 2026 22:28:21 -0400 (EDT) Date: Wed, 25 Mar 2026 11:28:17 +0900 From: Michael Paquier To: Robert Pang Cc: pgsql-hackers Subject: Re: [PATCH] Fix premature timeout in pg_promote() caused by signal interruptions Message-ID: References: MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha512; protocol="application/pgp-signature"; boundary="2CiSH/75PhcvBTdO" Content-Disposition: inline In-Reply-To: List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk --2CiSH/75PhcvBTdO Content-Type: text/plain; charset=us-ascii Content-Disposition: inline On Wed, Mar 11, 2026 at 09:44:07AM -0700, Robert Pang wrote: > The current implementation of pg_promote() calculates a fixed number > of loop iterations based on the timeout value, assuming each loop > waits exactly 100 ms for the backend latch. However, if the backend > receives an unrelated signal (e.g., from > client_connection_check_interval), it wakes up early. These repeated, > unrelated wakeups cause the loop counter to deplete much faster than > intended, leading to a premature timeout. It is true that we can do better here, and your proposal about having a more precise timeout calculation looks like a sensible improvement for this case. No objections regarding your patch. I would like to apply it on HEAD, if there are no objections. -- Michael --2CiSH/75PhcvBTdO Content-Type: application/pgp-signature; name=signature.asc -----BEGIN PGP SIGNATURE----- iQIzBAEBCgAdFiEEG72nH6vTowiyblFKnvQgOdbyQH0FAmnDSEEACgkQnvQgOdby QH1i4A//f+/y3EP9uTzWVIO3+m/Z0pQLEagiELlBpd8i3KsLj0LX1sjtcu3m/ESa dJRsFNYOKcGwIDaZFCQHfvaJvFBqJfKFfJ5dURszBLAguSSo3eNz6/HdD5Lu2RGb WY3yO6Foyg6SXQ54NAZdhzi/673hzUFSH57QJrjHPN9v2PZRHf5oH5TnaXMac4Fm HUbDN5YrhGAiRoYuE3Hcl2cGE3uCyTViAYf1SAKtqJdi80J0mjPZ0fkXvocHkPnM 8/+TjSXXk8japgh9fBpvJ4dKWYBbYd62aVoUs39daL+Gs7P5MKAqEljIia+UIyfO wQRWEQdHZIAPWUegLqRYFlDWDc7MCKYQyNcFR2HSmg5n1YVorBLcOzzEKPHq/+mt CCQ+e3Af0aRA4LurGUAi0zc2KEO+JozFUT3Oi0no9Mz3cYLjm68sIEYjzTNwnxvn vls5RXwaMmPOateddViqdP1snbYeMQyxuTkoNF/+i4zzmeEcTlHFxpRBFRYB9E7I W2O3Gk+vqBXuauyPioIlXE0e5tRC0bNcpj5tD9f79clK+TUrcXrIqV7RToXTtYfH 3epsOMN4l9n3o8maLio0umxETLZceRTbrvaVqmQxPiwc1ha/0cBzhtYekd9PtxA2 Rd9pmHm3uezLP69r7lvZ8ZojJjdpwkrdhcV34NEMqKE/Di5SE+0= =01+R -----END PGP SIGNATURE----- --2CiSH/75PhcvBTdO--