From: Peter Eisentraut <peter_e@gmx.net>
To: pgsql-committers@postgresql.org
Subject: pgsql: Fix crash when canceling parallel query
Date: Fri, 16 Feb 2018 21:22:05 +0000
Message-ID: <E1emnSH-0000PJ-Dx@gemulon.postgresql.org> (raw)
Fix crash when canceling parallel query
elog(FATAL) would end up calling PortalCleanup(), which would call
executor shutdown code, which could fail and crash, especially under
parallel query. This was introduced by
8561e4840c81f7e345be2df170839846814fa004, which did not want to mark an
active portal as failed by a normal transaction abort anymore. But we
do need to do that for an elog(FATAL) exit. Introduce a variable
shmem_exit_inprogress similar to the existing proc_exit_inprogress, so
we can tell whether we are in the FATAL exit scenario.
Reported-by: Andres Freund <andres@anarazel.de>
Branch
------
master
Details
-------
https://git.postgresql.org/pg/commitdiff/ad9a274778d2d88c46b90309212b92ee7fdf9afe
Modified Files
--------------
src/backend/storage/ipc/ipc.c | 7 +++++++
src/backend/utils/mmgr/portalmem.c | 8 ++++++++
src/include/storage/ipc.h | 1 +
3 files changed, 16 insertions(+)
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Reply to all the recipients from your mail client; the link fills in
the headers below: reply via email
Some clients, webmail especially, drop In-Reply-To and References from
a link, and the reply then starts a new thread: use the mbox below.
To: pgsql-committers@postgresql.org
Cc: peter_e@gmx.net
Subject: Re: pgsql: Fix crash when canceling parallel query
In-Reply-To: <E1emnSH-0000PJ-Dx@gemulon.postgresql.org>
References: <E1emnSH-0000PJ-Dx@gemulon.postgresql.org>
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox