Re: ExecAppendAsyncEventWait() in REL_14_STABLE can corrupt PG_exception_stack

Michael Paquier <michael@paquier.xyz>

From: Michael Paquier <michael@paquier.xyz>
To: Etsuro Fujita <etsuro.fujita@gmail.com>
Cc: Alexander Pyhalov <a.pyhalov@postgrespro.ru>, Pgsql Hackers <pgsql-hackers@postgresql.org>
Date: 2024-02-25T23:37:20Z
Lists: pgsql-hackers
On Sun, Feb 25, 2024 at 06:34:30PM +0900, Etsuro Fujita wrote:
> I think this would happen when FDWs configure no events; IIRC I think
> while the core allows them to do so, postgres_fdw does not do so, so
> this would never happen with it.  Anyway, thanks for the report and
> patch, Alexander!

I don't see how that's directly your fault as this is a thinko in the
set of commits 481d7d1c01, 555276f859 and 501cfd07da that have hit
14~16, ignoring entirely the TRY/CATCH block.

Anyway, if you want to address it yourself, feel free to go ahead,
thanks!  I would have done it but I've been busy with life stuff for
the last couple of days.
--
Michael

Commits

  1. Fix bogus coding in ExecAppendAsyncEventWait().

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

  3. postgres_fdw: Fix handling of pending asynchronous requests.

  4. Add support for asynchronous execution.