public inbox for [email protected]  
help / color / mirror / Atom feed
From: Tom Lane <[email protected]>
To: Robert Haas <[email protected]>
Cc: Andres Freund <[email protected]>
Cc: Bharath Rupireddy <[email protected]>
Cc: PostgreSQL Hackers <[email protected]>
Subject: Re: Issue with cancel_before_shmem_exit while searching to remove a particular registered exit callbacks
Date: Mon, 10 Aug 2020 15:41:33 -0400
Message-ID: <[email protected]> (raw)
In-Reply-To: <CA+TgmobBH1SGmQY6G9x4nth03bJXyg2FXEbmNqs-_aRp1peAgQ@mail.gmail.com>
References: <CALj2ACWk7j4F2v2fxxYfrroOF=AdFNPr1WsV+AGtHAFQOqm_pw@mail.gmail.com>
	<[email protected]>
	<[email protected]>
	<CA+TgmoZDFyV1RAmTEKvjaV8TvvS+gKha+RRiJUGMOLoY0-8Ekw@mail.gmail.com>
	<CA+TgmobdNtd+6gr2zFH6mTSDoNAwYNt=z=Jr1h59vM+PYrbQeQ@mail.gmail.com>
	<CA+Tgmoa_VpiNjKurhkScXaZbu6s7=NP6PL0NL4fMgstXNeGfPQ@mail.gmail.com>
	<CALj2ACX6O=UnQjR7p4nED45oWzj2gXWaXgcUmk_MwfVBVMQM9A@mail.gmail.com>
	<CA+TgmoY8hrNE-sO+B95M8AD6CL9VohSMik2VZkrnkbANRDS5gw@mail.gmail.com>
	<[email protected]>
	<CA+TgmoYgNMc7x814iih==wH-jN-4bO_FH_xWBdV5HEK=6e3kDQ@mail.gmail.com>
	<[email protected]>
	<CA+TgmobBH1SGmQY6G9x4nth03bJXyg2FXEbmNqs-_aRp1peAgQ@mail.gmail.com>

Robert Haas <[email protected]> writes:
> Perhaps we really have four categories here:
> (1) Temporary handlers for PG_ENSURE_ERROR_CLEANUP().
> (2) High-level cleanup that needs to run after aborting out of the
> current transaction.
> (3) Per-subsystem shutdown for shared memory stuff.
> (4) Per-subsystem shutdown for backend-private stuff.

Hmm, I don't think we actually have any of (2) do we?  Or at least
we aren't using ipc.c callbacks for them.

> What I do think we should do, after thinking about it more,
> is discourage the casual use of before_shmem_exit() for things where
> on_shmem_exit() or on_proc_exit() would be just as good. I think
> that's what would avoid the most problems here.

I think we're mostly in violent agreement here.  The interesting
question seems to be Andres' one about whether before_shmem_exit
actually has any safe use except for PG_ENSURE_ERROR_CLEANUP.
It may not, in which case perhaps we oughta rename it?

			regards, tom lane





view thread (28+ messages)  latest in thread

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 using the --to and --cc options:
  reply via email

  To: [email protected]
  Cc: [email protected], [email protected], [email protected], [email protected], [email protected]
  Subject: Re: Issue with cancel_before_shmem_exit while searching to remove a particular registered exit callbacks
  In-Reply-To: <[email protected]>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by agora; see mirroring instructions
for how to clone and mirror all data and code used for this inbox