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 1w5BSH-002yz3-1Q for pgsql-hackers@arkaria.postgresql.org; Tue, 24 Mar 2026 23:46:38 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.96) (envelope-from ) id 1w5BSF-009kNg-2y for pgsql-hackers@arkaria.postgresql.org; Tue, 24 Mar 2026 23:46:36 +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.96) (envelope-from ) id 1w5BSF-009kNY-0i for pgsql-hackers@lists.postgresql.org; Tue, 24 Mar 2026 23:46:36 +0000 Received: from fout-a6-smtp.messagingengine.com ([103.168.172.149]) by magus.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.98.2) (envelope-from ) id 1w5BSB-00000000xsL-3lXh for pgsql-hackers@lists.postgresql.org; Tue, 24 Mar 2026 23:46:35 +0000 Received: from phl-compute-04.internal (phl-compute-04.internal [10.202.2.44]) by mailfout.phl.internal (Postfix) with ESMTP id 2125EEC00D2; Tue, 24 Mar 2026 19:46:30 -0400 (EDT) Received: from phl-frontend-03 ([10.202.2.162]) by phl-compute-04.internal (MEProxy); Tue, 24 Mar 2026 19:46:30 -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=1774395990; x=1774482390; bh=f2OmbLhydI MOYi/WV9OmsxCS0ydib+FK8BggiTdJry4=; b=nyQIcmb6ltdPCmVOx9IA74OoRX fjpwpEpYskqBNG99FwPhK0HFWbgGM1EsixWo1ArLVbskueJ9Ev4l8bUKo6S8978y X/WwzmiJ58RhUB0SNGZaVDwc44M0YWnr0J0521+2RtKmMHnb50lrJQ2m3+p5Mi+K P+oSe+ZCqEXQYKQVJMzwA0BI5jgtnOjT8wCTPVH9vX0GS3NaGxOvatVp8pdX9Yj8 dvt7zM/ApotOZ1gOburg9druTeQm4WX7xgvkCnauRDB0l0tZ8kLiuzP5tJTLnSQN HHRbMv/S0vEwZ9nOzi/vRfSDoXMyeYxeeUz2AEsyInxo1ww97QUPVn8IvPVA== 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= 1774395990; x=1774482390; bh=f2OmbLhydIMOYi/WV9OmsxCS0ydib+FK8Bg giTdJry4=; b=1ry5KOSCAPKB1HutCNCC4cpKGW6gX2qV4FHzC7xhQaF7XXcsX0V q8q+8kE8ohldlhvTwMo7TLKSDXAEg46Xjo9ruNf0iNqI20pvcJnbF3vpNUj8u0Qg 6uXbM7pGh9uWwRnVvPcYJJz0P0CavLQcJxgFpCvbgVl1jozMJvk/ARdl62ZYQx6E sCW84dDRqpZgtIk4/Z4sXhhXxksQoT9LtP8HUpEybVsQBK/m8mQ4gZeiNgyr8rm5 VAfzXvC+QqCnhEaV+gwTonfKaUxFQD6t3kZjVXc7yfy2lCCCfcn+mKTvyYOD25jo i0YXg/sKHkQ7eEJOQsRjj4i3CGqyqreTFEA== X-ME-Sender: X-ME-Received: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgeefgedrtddtgdefvddvleegucetufdoteggodetrf dotffvucfrrhhofhhilhgvmecuhfgrshhtofgrihhlpdfurfetoffkrfgpnffqhgenuceu rghilhhouhhtmecufedttdenucesvcftvggtihhpihgvnhhtshculddquddttddmnegfrh hlucfvnfffucdljedtmdenucfjughrpeffhffvvefukfhfgggtuggjsehgtderredttddv necuhfhrohhmpefoihgthhgrvghlucfrrghquhhivghruceomhhitghhrggvlhesphgrqh huihgvrhdrgiihiieqnecuggftrfgrthhtvghrnhepteelieefudffhffhtdetleeggeeg fffhkeeuveetiefgudduvedutefggeeivdejnecuvehluhhsthgvrhfuihiivgeptdenuc frrghrrghmpehmrghilhhfrhhomhepmhhitghhrggvlhesphgrqhhuihgvrhdrgiihiidp nhgspghrtghpthhtohephedpmhhouggvpehsmhhtphhouhhtpdhrtghpthhtoheprghnug hrvghssegrnhgrrhgriigvlhdruggvpdhrtghpthhtohepsggvrhhtrhgrnhguughrohhu vhhothdrphhgsehgmhgrihhlrdgtohhmpdhrtghpthhtohepphhgshhqlhesjhdquggrvh hishdrtghomhdprhgtphhtthhopehhthgrmhhfihgushesghhmrghilhdrtghomhdprhgt phhtthhopehpghhsqhhlqdhhrggtkhgvrhhssehlihhsthhsrdhpohhsthhgrhgvshhqlh drohhrgh X-ME-Proxy: Feedback-ID: i0fe9450f:Fastmail Received: by mail.messagingengine.com (Postfix) with ESMTPA; Tue, 24 Mar 2026 19:46:28 -0400 (EDT) Date: Wed, 25 Mar 2026 08:46:23 +0900 From: Michael Paquier To: Andres Freund Cc: Bertrand Drouvot , Jeff Davis , Greg Sabino Mullane , pgsql-hackers@lists.postgresql.org Subject: Re: Adding locks statistics Message-ID: References: MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha512; protocol="application/pgp-signature"; boundary="+zaYSPkVvBWW9eqL" Content-Disposition: inline In-Reply-To: List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk --+zaYSPkVvBWW9eqL Content-Type: text/plain; charset=us-ascii Content-Disposition: inline On Tue, Mar 24, 2026 at 04:09:37PM -0400, Andres Freund wrote: > The test is extremely unstable on windows. On CI 10/16 runs since the test in > failed due to it, afaict. I am not surprised by that. Windows is good in catching race conditions. > I don't see how a test with a timeout setting that's anywhere remotely close > to 10ms could be expected to be stable. Well, the low value of deadlock_timeout is not the problem. The shorter the better to make the test go faster with more deadlock checks. What the buildfarm is telling is that we do not have the time to process the deadlock_timeout request, and that we would need to pay the cost of longer sleep if coded this way. This is going to cost in runtime on fast machines where the CheckDeadLock() call would happen quickly. And on slow machines, we don't have the guarantee that the sleep would be long enough to process the deadlock request. This test would be better if rewritten as a TAP test, I guess, with a NOTICE injection point before the CheckDeadLock() call in ProcSleep() to make sure that the second session processes the deadlock timeout request while it is waiting on its lock to be acquired. One trickier part is that we only care about the deadlock_timeout in s2, because we want to measure the wait it has waited until the lock could be acquired, meaning that we should make s1 use a large deadlock_timeout to avoid interferences with a global injpoint. I don't have the credits to test that in the CI for this month, unfortunately, and this creates noise in the CI for the work of other folks in this release cycle, so I am going to remove this test for now. > Also, anything that requires short sleeps (like pg_sleep(0.05);) is extremely > likely to be a long time test stability hazard. It's a huge "test smell" to > me, to the point that I think every single sleep in a test needs a comment > explaining why that one use of sleep is correct, and that comment better be > signed in blood. Yep, agreed. -- Michael --+zaYSPkVvBWW9eqL Content-Type: application/pgp-signature; name=signature.asc -----BEGIN PGP SIGNATURE----- iQIzBAEBCgAdFiEEG72nH6vTowiyblFKnvQgOdbyQH0FAmnDIk8ACgkQnvQgOdby QH2hSQ//X+3U4SJlKj5hKSCTF81C1cn6A7vegdLLSVqSJr/3QbaOgqTTjUj1aqnF w4bklLLJo+EFunh1FzpUKkqC1RMEzOU5TJD1f8z8wk6/EM9oR4un9DXa9Z0trUzP 6vsQB4Mw3JgWOPTR7aaWb6mDXvMmOEt/eFGu2CCzXmaVDpS3dHLbZsOuLnQqC40q 73NcDU1LSDSM2WPm8iS7ULTE3ckbwVhOXceUVtOrN3Sz7GyKgC/ItVSLit6nV5HM SwPoAEdknwwl/Ky62HrEIGoH9y+gdHQtPUx5QV4OLSBmZofJsB7txP6nzNu7znVg N43McUYKuLuz79IESMImrf3NCYBf8EOXmWJBJ3YleMJMvaZ/GAONI59L1OdN+nv2 kMXP7TTnO3mrrQ+Jn92OCmSZAMDX1GI+gooZWt2qlyi0uAruR8a3QMbZUMccvluq 7ioGjjMU1pDFeCFlkSylQU5jrcj0wFl0sczRQfXvXRU5gz0zCAxgm1+dJDkLSNCc fk3Xq8wxuwbo3ZyEzDc59TJ86uTqnWGnoMJqday7NVQBPVbDy1Pgp/it7HF+xHsX 5hi+Ie9tFAun8fSloORnn1ixaZ4NjGron6JRrGPMFpWTZLyt4qzXUsraB4qprUuI fc+XRBa+tN4nTYVgseSmD6P+nK9QYO3lJUommOfAwx19D4ik+fc= =eRe7 -----END PGP SIGNATURE----- --+zaYSPkVvBWW9eqL--