Re: [PATCH] LockAcquireExtended improvement

Will Mortensen <will@extrahop.com>

From: Will Mortensen <will@extrahop.com>
To: Robert Haas <robertmhaas@gmail.com>
Cc: Jingxian Li <aqktjcm@qq.com>, andres <andres@anarazel.de>, PostgreSQL Hackers <pgsql-hackers@lists.postgresql.org>
Date: 2024-05-18T06:38:35Z
Lists: pgsql-hackers

Attachments

On Tue, Mar 26, 2024 at 7:14 PM Will Mortensen <will@extrahop.com> 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 = true, this is a deadlock; if dontWait = 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 = 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".

Here's a patch fixing those typos.

Commits

  1. Fix typo and comments related to the recent no-wait lock improvements

  2. Allow a no-wait lock acquisition to succeed in more cases.