Re: Issue with cancel_before_shmem_exit while searching to remove a particular registered exit callbacks

Поиск
Список
Период
Сортировка
От Andres Freund
Тема Re: Issue with cancel_before_shmem_exit while searching to remove a particular registered exit callbacks
Дата
Msg-id 20200811001102.bwcwmrwgirxyec6i@alap3.anarazel.de
обсуждение исходный текст
Ответ на Re: Issue with cancel_before_shmem_exit while searching to remove a particular registered exit callbacks  (Robert Haas <robertmhaas@gmail.com>)
Ответы Re: Issue with cancel_before_shmem_exit while searching to remove a particular registered exit callbacks  (Tom Lane <tgl@sss.pgh.pa.us>)
Список pgsql-hackers
Hi,

On 2020-08-10 15:50:19 -0400, Robert Haas wrote:
> On Mon, Aug 10, 2020 at 3:41 PM Tom Lane <tgl@sss.pgh.pa.us> wrote:
> > > 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?

> If we could eliminate the other places where it's used, that'd be
> great. That's not too clear to me, though, because of the above two
> cases.

I think there's two different aspects here: Having before_shmem_exit(),
and having cancel_before_shmem_exit(). We could just not have the
latter, and instead use a separate list for PG_ENSURE_ERROR_CLEANUP
internally. With the callback for PG_ENSURE_ERROR_CLEANUP calling those
from its private list.  There's no other uses of
cancel_before_shmem_exit afaict.

I guess alternatively we at some point might just need a more complex
callback system, where one can specify where in relation to another
callback a callback needs to be registered etc.

Greetings,

Andres Freund



В списке pgsql-hackers по дате отправления:

Предыдущее
От: Alvaro Herrera
Дата:
Сообщение: Re: remove spurious CREATE INDEX CONCURRENTLY wait
Следующее
От: Andres Freund
Дата:
Сообщение: Re: Hybrid Hash/Nested Loop joins and caching results from subplans