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 1tqKRa-0036qC-II for pgsql-hackers@arkaria.postgresql.org; Thu, 06 Mar 2025 23:15:59 +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 1tqKRZ-00CooP-2c for pgsql-hackers@arkaria.postgresql.org; Thu, 06 Mar 2025 23:15:57 +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 1tqKRY-00ConD-2t for pgsql-hackers@lists.postgresql.org; Thu, 06 Mar 2025 23:15:56 +0000 Received: from fhigh-a1-smtp.messagingengine.com ([103.168.172.152]) by magus.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.96) (envelope-from ) id 1tqKRT-001OHj-2k for pgsql-hackers@postgresql.org; Thu, 06 Mar 2025 23:15:55 +0000 Received: from phl-compute-13.internal (phl-compute-13.phl.internal [10.202.2.53]) by mailfhigh.phl.internal (Postfix) with ESMTP id B3517114015C; Thu, 6 Mar 2025 18:15:50 -0500 (EST) Received: from phl-mailfrontend-01 ([10.202.2.162]) by phl-compute-13.internal (MEProxy); Thu, 06 Mar 2025 18:15:50 -0500 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=1741302950; x=1741389350; bh=L+vaWtlVdW IlyAaN+lIRQu8pwTP1ph2LqTuuyc45oZc=; b=5BsDlbLhcA1vjoIQiZjo79kL+J NTefG0+AIVgfxm2sm030vD8ISHi21qtP4LaVRwacB7MKlGYJc7wgGHSloK79zkot l6+WZjJkAFD9FU3pFhZ7FGj0Mz0DlrJH8W77L9JgKUNuz6WOWVuQ7mGnLnBfTMLv EYoesuRXuDFRJWmHPu7Fp34IRBML/y9gfma2c3VmLNHAXKPGa3G8fKqhvvUMs2rH 1NM/4mQilX2n1GFRhGAK0nq7n1+32CBepU7owGyukS0/44uSblntvcSjjxBiFeth K/IDHAeBQczHQNT7iS+I7FJDf4R3+srzugD8UnJRK2CBgs22sXIEpQ8QiupQ== 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= 1741302950; x=1741389350; bh=L+vaWtlVdWIlyAaN+lIRQu8pwTP1ph2LqTu uyc45oZc=; b=FdUxI86qpNNvRuv7IQZ2Vtpdyvv5Fmp4yl5vCufa3wzaYZMimjw 5tyCuQtQmHMfpc11ZhretBqDCfkb4PixACbNotlqbAdVgp/WBTNDzIZj5t+7MSwk 3XGE7Ji6uv+KX78A7ud+xiasRkOxGeXIaWoNPazmGtT66IEDU+nZaY2xwTOLeELI d0DMmcI21meLyhxjftAA5iMreFi8hX3PIoL3uOKfBrANteVKfBy+vwrQkicueBKj 48uzA6jclWlr3JDCAKlQgviC3C2US/6u0U6xIRLjG2hFAnO2Akzx4NQ91/mmFxIS baHx34T/Jv+/chGir9CCxbCXpXrV3S1+hPQ== X-ME-Sender: X-ME-Received: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgeefvddrtddtgddutdeltdehucetufdoteggodetrf dotffvucfrrhhofhhilhgvmecuhfgrshhtofgrihhlpdggtfgfnhhsuhgsshgtrhhisggv pdfurfetoffkrfgpnffqhgenuceurghilhhouhhtmecufedttdenucesvcftvggtihhpih gvnhhtshculddquddttddmnegfrhhlucfvnfffucdljedtmdenucfjughrpeffhffvvefu kfhfgggtuggjsehgtderredttdejnecuhfhrohhmpefoihgthhgrvghlucfrrghquhhivg hruceomhhitghhrggvlhesphgrqhhuihgvrhdrgiihiieqnecuggftrfgrthhtvghrnhep veetjefgjeevgedukeehieeuieeuieevueeiudegheevuefggfduueelgeelieetnecuve hluhhsthgvrhfuihiivgeptdenucfrrghrrghmpehmrghilhhfrhhomhepmhhitghhrggv lhesphgrqhhuihgvrhdrgiihiidpnhgspghrtghpthhtohepkedpmhhouggvpehsmhhtph houhhtpdhrtghpthhtohepjhgrtghosgdrtghhrghmphhiohhnsegvnhhtvghrphhrihhs vggusgdrtghomhdprhgtphhtthhopegrnhgurhgvshesrghnrghrrgiivghlrdguvgdprh gtphhtthhopehrohgsvghrthhmhhgrrghssehgmhgrihhlrdgtohhmpdhrtghpthhtohep nhhorghhsehlvggruggsohgrthdrtghomhdprhgtphhtthhopegrnhgurhgvfiesughunh hslhgrnhgvrdhnvghtpdhrtghpthhtohepphhgshhqlhdqhhgrtghkvghrshesphhoshht ghhrvghsqhhlrdhorhhgpdhrtghpthhtohepvghulhgvrhdrthgrvhgvihhrrgesvghnth gvrhhprhhishgvuggsrdgtohhmpdhrtghpthhtohepuggrnhhivghlseihvghsqhhlrdhs vg X-ME-Proxy: Feedback-ID: i0fe9450f:Fastmail Received: by mail.messagingengine.com (Postfix) with ESMTPA; Thu, 6 Mar 2025 18:15:47 -0500 (EST) Date: Fri, 7 Mar 2025 08:15:38 +0900 From: Michael Paquier To: Jacob Champion Cc: Andres Freund , Robert Haas , Noah Misch , Andrew Dunstan , PostgreSQL Hackers , Euler Taveira , Daniel Gustafsson Subject: Re: [PATCH] pg_stat_activity: make slow/hanging authentication more visible Message-ID: References: MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha512; protocol="application/pgp-signature"; boundary="GuyiGmbs0+HRQNeK" Content-Disposition: inline In-Reply-To: List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk --GuyiGmbs0+HRQNeK Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Thu, Mar 06, 2025 at 02:25:07PM -0800, Jacob Champion wrote: > On Wed, Mar 5, 2025 at 8:08=E2=80=AFPM Michael Paquier wrote: >> + WHERE state =3D 'starting' and wait_event =3D 'init-pre-auth';}); >=20 > Did you have thoughts on expanding the check to backend_type [1]? >=20 >> + # Give up. The output of the last attempt is logged by query(), >> + # so no need to do anything here. >> + return 0; >=20 > One of my primary complaints about the poll_query_until() > implementation is that "giving up" in this case means continuing to > run pieces of the test that have no business running after a timeout, > and increasing the log noise after a failure. I'm not sure how loudly > to complain in this particular case, since I know we use it > elsewhere... Indeed. The existing poll_query_until() is a bit more reliable in terms of error handling, even with a very low PG_TEST_TIMEOUT_DEFAULT. A second thing that was bugging me on a second lookup this morning is how we should handle error cases. A background psql process depends on what the caller defines for ON_ERROR_STOP. In the case of this test, we're OK to fail immediately because we expect the queries to always work. I'm not sure if this is fine by default, especially if callers of this routine expect to have the same properties as poll_query_until() in Cluster.pm. They would not, because a BackgroundPsql is an entire different object, except if given options when staring psql to act like that. I have applied the simplest patch for now, to silence the failures in the CI, and included your suggestion to add a check on the backend_type for the extra safety it offers. I'd like the addition of the poll_query_until() in the long-term, but I'm really not sure if the semantics would be right this way under a background psql. In the auth 007 test, they would be OK, but it could be surprising if we have other callers that begin relying on it. -- Michael --GuyiGmbs0+HRQNeK Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iQIzBAABCgAdFiEEG72nH6vTowiyblFKnvQgOdbyQH0FAmfKLJoACgkQnvQgOdby QH1PRw/8CRgRYf7c2qxNkv2ol6egJ7HWhzZG+/ZNGyHAWMuu5g5MS32xWS04Mwx6 Ae0QsKEhAesXvv3nU/opNh4NvEnsIpXSTock4NHkxrZB6qvFSvObmNT3pNdA6G8S lRw5XgPytB6e38wjWtI93nFIWMHbll+ysE04R0ZUXx1I9xUGApl8Q1Fwsvw0Fvos XwhYR0AhtC+fKLIM9BKcHFxeZx4inh6nh5IgEL/nitjga5+bE7ML5lXOtgsVOodx cZo39/VAF/vR6F9TEjb5XXcsIZHklCFueUqNLHxZTHuoLKlmkcpYCcVX93l70J8D 5X6rPY6QxVed6JWGVhmd7+PRLmWaK6+qO8Xb8eJ3GD/vygUozQBGSOj1I5WdWHz5 QV4t/2bapaiB2e6i3dtZfs00saccxMyZI5XFxYBn+IQ1HhdbcXYIaI/Lzq22UQWz OpZpONa3MNyZK91cIX3aEC4zZGu8UzCgg0f+Q42OyqeprQlbdUyyUnuwJDKUax0U rVu6HhaW/11ZmGBq+sKCHWc9Tz6aJF7pJr2PpFtLZkspnnGFnyGspBl4DiaBG1Og PF0CmXbd+/qKTkWxKy5V6IB22v5s3C07tTE4A917Seae7CCiHM5kR2VZWlERlHnK 9vtME9aEqmylD79ZFfvE2VyrCjf5KyfFVxTbsG7t01VY3avgWXc= =L9Wo -----END PGP SIGNATURE----- --GuyiGmbs0+HRQNeK--