pg.ddx.io  pgsql-committers@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Tom Lane <tgl@sss.pgh.pa.us>
To: pgsql-committers@lists.postgresql.org
Subject: pgsql: Install an error check into cancel_before_shmem_exit().
Date: Tue, 08 Sep 2020 19:54:34 +0000
Message-ID: <E1kFjhK-0004Wn-Tv@gemulon.postgresql.org> (raw)

Install an error check into cancel_before_shmem_exit().

Historically, cancel_before_shmem_exit() just silently did nothing
if the specified callback wasn't the top-of-stack.  The folly of
ignoring this case was exposed by the bugs fixed in 303640199 and
bab150045, so let's make it throw elog(ERROR) instead.

There is a decent argument to be made that PG_ENSURE_ERROR_CLEANUP
should use some separate infrastructure, so it wouldn't break if
something inside the guarded code decides to register a new
before_shmem_exit callback.  However, a survey of the surviving
uses of before_shmem_exit() and PG_ENSURE_ERROR_CLEANUP doesn't
show any plausible conflicts of that sort today, so for now we'll
forgo the extra complexity.  (It will almost certainly become
necessary if anyone ever wants to wrap PG_ENSURE_ERROR_CLEANUP
around arbitrary user-defined actions, though.)

No backpatch, since this is developer support not a production issue.

Bharath Rupireddy, per advice from Andres Freund, Robert Haas, and myself

Discussion: https://postgr.es/m/CALj2ACWk7j4F2v2fxxYfrroOF=AdFNPr1WsV+AGtHAFQOqm_pw@mail.gmail.com

Branch
------
master

Details
-------
https://git.postgresql.org/pg/commitdiff/c9ae5cbb8834dd440cdfa7058c03443f98436284

Modified Files
--------------
src/backend/storage/ipc/ipc.c | 9 ++++++---
1 file changed, 6 insertions(+), 3 deletions(-)



Message-ID: <E1kFjhK-0004Wn-Tv@gemulon.postgresql.org>
Permalink:  ../E1kFjhK-0004Wn-Tv@gemulon.postgresql.org/
Also on:    postgresql.org/message-id/E1kFjhK-0004Wn-Tv@gemulon.postgresql.org

 · 

reply

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: tgl@sss.pgh.pa.us
  Subject: Re: pgsql: Install an error check into cancel_before_shmem_exit().
  In-Reply-To: <E1kFjhK-0004Wn-Tv@gemulon.postgresql.org>
  References: <E1kFjhK-0004Wn-Tv@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