Re: Use-after-free issue in postgres_fdw

Etsuro Fujita <etsuro.fujita@gmail.com>

From: Etsuro Fujita <etsuro.fujita@gmail.com>
To: Michael Paquier <michael@paquier.xyz>
Cc: PostgreSQL Hackers <pgsql-hackers@lists.postgresql.org>
Date: 2026-05-05T10:19:54Z
Lists: pgsql-hackers
On Fri, May 1, 2026 at 9:05 PM Etsuro Fujita <etsuro.fujita@gmail.com> wrote:
> On Mon, Apr 27, 2026 at 5:07 PM Michael Paquier <michael@paquier.xyz> wrote:
> > On Fri, Apr 24, 2026 at 01:59:22AM -0700, Etsuro Fujita wrote:
> > > Right, this patch delays discarding the failed connection until abort
> > > cleanup of the top transaction, so it is guaranteed that anyone that
> > > uses it can safely refer to its PGconn when needed.
> >
> > +-- test handling of abort-cleanup-failed connections
> >
> > Perhaps this could be more descriptive, like "test cleanup of failed
> > connections on abort"?
>
> Sounds better.  I'll modify the comment as such, and if no objections,
> push an updated version and back-patch it to all supported versions.

Pushed and backpatched after modifying the comment as proposed,
tweaking a code comment a bit, and adding a variant of a test case.

Best regards,
Etsuro Fujita