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 1s8IO7-00BYDM-LP for pgsql-hackers@arkaria.postgresql.org; Sat, 18 May 2024 11:38:09 +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 1s8IO5-005Foc-Kq for pgsql-hackers@arkaria.postgresql.org; Sat, 18 May 2024 11:38:05 +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.94.2) (envelope-from ) id 1s8IO3-005FoT-SA for pgsql-hackers@lists.postgresql.org; Sat, 18 May 2024 11:38:05 +0000 Received: from fout4-smtp.messagingengine.com ([103.168.172.147]) by makus.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1s8INu-000oIW-24 for pgsql-hackers@lists.postgresql.org; Sat, 18 May 2024 11:38:00 +0000 Received: from compute7.internal (compute7.nyi.internal [10.202.2.48]) by mailfout.nyi.internal (Postfix) with ESMTP id 451C11381E6D; Sat, 18 May 2024 07:37:52 -0400 (EDT) Received: from mailfrontend2 ([10.202.2.163]) by compute7.internal (MEProxy); Sat, 18 May 2024 07:37:52 -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=1716032272; x=1716118672; bh=UwILRsZ4tQ 6NIUO34o13BXnacEuA+1t6beU+R93/Lfg=; b=KsYo0HQGmYC3iiEMd0yEaFp5Cc OaoBcvB+pyDG69q+NQB+n+ZEd4E/ZFW5FY1kvv57GBB6Bw+QkY9I4CE0zobhQrmu f0AwsqezrDOVEkhudIoF1TejHSDzXKhBTdcSNLbzpI7QOuhNvzrcHMKkI2N8SR8U pcc4/8SZxGulrJUoaEzZetP5U/dD0hFtp8jqQbL3MpTxj5vUr63fkJ3gEKufnf5R JnOjxRww6nZexaWk7rufNCHXSVnMw6P5we9X2rzpDYj2E91yo2cgQvzxn/rStuzi KpBKf3lHlM9y4XeNsPgbb90nJayIC2cZEBMetA+SU7G+pCZeYmfeMPvg90tA== 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-proxy:x-me-sender:x-me-sender:x-sasl-enc; s= fm1; t=1716032272; x=1716118672; bh=UwILRsZ4tQ6NIUO34o13BXnacEuA +1t6beU+R93/Lfg=; b=iqZaM0X7tg+B/QJ3aoF7tgBTbIWLMxuzuukFnInynDjF 5yjpCS/5+2AnvZDAUsveRegfbkWmFB2NxSaVJpbD42ngU9s4NjLtK9KTVaBx1FNO Hw3aX/Cdf05HsrdUcgQyenm5EPXyUj7dfnG1nN/I0lfRJZ7gEimfFT6DoBhnq0SD klJc5y2HcGeoibMu1PESHkxpFCCOPqNlRSGQoeKdTjJ6M1Pdhrpy5IY4JVtwf9kN 4EDZqIk9AO1LbnWg4qin0kqM9WYsgrlEmjubHTWbjSPmOmGcza6TgJU++E3YHlGS GUgZXO15n4gXhavpq0+53qojJVNWEIEsYtbbv/lVJg== X-ME-Sender: X-ME-Received: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgedvledrvdehiedgfeehucetufdoteggodetrfdotf fvucfrrhhofhhilhgvmecuhfgrshhtofgrihhlpdfqfgfvpdfurfetoffkrfgpnffqhgen uceurghilhhouhhtmecufedttdenucesvcftvggtihhpihgvnhhtshculddquddttddmne gfrhhlucfvnfffucdlfeehmdenucfjughrpeffhffvvefukfhfgggtuggjsehgtderredt tdejnecuhfhrohhmpefoihgthhgrvghlucfrrghquhhivghruceomhhitghhrggvlhesph grqhhuihgvrhdrgiihiieqnecuggftrfgrthhtvghrnhepveetjefgjeevgedukeehieeu ieeuieevueeiudegheevuefggfduueelgeelieetnecuvehluhhsthgvrhfuihiivgeptd enucfrrghrrghmpehmrghilhhfrhhomhepmhhitghhrggvlhesphgrqhhuihgvrhdrgiih ii X-ME-Proxy: Feedback-ID: i0fe9450f:Fastmail Received: by mail.messagingengine.com (Postfix) with ESMTPA; Sat, 18 May 2024 07:37:50 -0400 (EDT) Date: Sat, 18 May 2024 20:37:35 +0900 From: Michael Paquier To: Will Mortensen Cc: Robert Haas , Jingxian Li , andres , PostgreSQL Hackers Subject: Re: [PATCH] LockAcquireExtended improvement Message-ID: References: <202402081828091711555@qq.com> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha512; protocol="application/pgp-signature"; boundary="8N4RVyHvuVkP4mp7" Content-Disposition: inline In-Reply-To: List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk --8N4RVyHvuVkP4mp7 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Fri, May 17, 2024 at 11:38:35PM -0700, Will Mortensen wrote: > On Tue, Mar 26, 2024 at 7:14=E2=80=AFPM Will Mortensen wrote: >> This comment on ProcSleep() seems to have the values of dontWait >> backward (double negatives are tricky): >> >> * Result: PROC_WAIT_STATUS_OK if we acquired the lock, >> PROC_WAIT_STATUS_ERROR >> * if not (if dontWait =3D true, this is a deadlock; if dontWait =3D = false, we >> * would have had to wait). >> >> Also there's a minor typo in a comment in LockAcquireExtended(): >> >> * Check the proclock entry status. If dontWait =3D true, this is an >> * expected case; otherwise, it will open happen if something in the >> * ipc communication doesn't work correctly. >> >> "open" should be "only". >=20 > Here's a patch fixing those typos. Perhaps, this, err.. Should not have been named "dontWait" but "doWait" ;) Anyway, this goes way back in time and it is deep in the stack (LockAcquireExtended, etc.) so it is too late to change: the patch should be OK as it is. -- Michael --8N4RVyHvuVkP4mp7 Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iQIzBAABCgAdFiEEG72nH6vTowiyblFKnvQgOdbyQH0FAmZIkv8ACgkQnvQgOdby QH0m0w//TYEnyLebLTa517xInSkvR3kwyXY9z8cGl+BM/tYgC0mVDiruWVjTBV48 OX+o+92onX+zOuEfmlwpDSiLWRMGMxe4FY2pCeLjqtrLi6wrx7yM/tDR2P4iDDpz Dc+EOff65P8+wmjisN2AhBsZXKhmrWERH65Up++n11jkhL/4Jzuyrz+vOjSDPg9e m2GQU7VciroivPRq7E8Rg39aYraR/XeO25pfGPmuV72fJRkFAP/Df5RoF8VTg7RM JC12wAjs/jEFXaqZY6gAzYeKdq9qlJNUeFN30VclLCkOSNOD7zZmWAzC+SW1FAyO xv1HFCf7KejFfoVL4gq2hjdHMEF0daZr7nbNgd08Hu3Qb4X3GZd90vD+yRznwGwt vSW8D45xcZLlnCbEvPeNBXqz/F9DHsjRYT0EEmYL0f6QWQ/lEMSBY68Iw0uybGjU NxZboVi+4lfWPSEHMZt+4XVJD4MzmR/i6uNWNXVkq5QB+HLaxxRppucykszJLI90 RBZ5JQDGLOFrWU6CLGKglvJOp6tE+0hD2/45RomqQlX2HPJEvw4pAXx/SKy0RRg1 0GcRPftwmxvPEtTjALC5xSs3DzXJ5KSQcnZCEA/K1HOFS6G24i/zW42RGvnX3tgS 6z8IBJ4yFV8eR0KqIumhotg7DN/Z8Xd95XjJbI6J5qoCYpyvrDs= =mCQ4 -----END PGP SIGNATURE----- --8N4RVyHvuVkP4mp7--