Re: Another WaitEventSet resource leakage in back branches

Etsuro Fujita <etsuro.fujita@gmail.com>

From: Etsuro Fujita <etsuro.fujita@gmail.com>
To: PostgreSQL Hackers <pgsql-hackers@lists.postgresql.org>
Date: 2024-04-05T10:55:16Z
Lists: pgsql-hackers

Attachments

On Fri, Mar 22, 2024 at 9:15 PM Etsuro Fujita <etsuro.fujita@gmail.com> wrote:
> While working on [1], I noticed $SUBJECT: WaitLatchOrSocket in back
> branches is ignoring the possibility of failing partway through, too.
> I added a PG_FAINALLY block to that function, like commit 555276f85.
> Patch attached.

I noticed that PG_FAINALLY was added in v13.  I created a separate
patch for v12 using PG_CATCH instead.  Patch attached.  I am attaching
the previous patch for later versions as well.

I am planning to back-patch these next week.

Best regards,
Etsuro Fujita

Commits

  1. Fix WaitEventSet resource leak in WaitLatchOrSocket().

  2. Fix resource leak when a FDW's ForeignAsyncRequest function fails