[PATCH] ProcessInterrupts_hook

Поиск
Список
Период
Сортировка
От Craig Ringer
Тема [PATCH] ProcessInterrupts_hook
Дата
Msg-id CAGRY4nzm+=ZBkWDaBXPQeHGqd5xAc4ukUR+Ph2mEeqj1j5ycRQ@mail.gmail.com
обсуждение исходный текст
Ответы Re: [PATCH] ProcessInterrupts_hook  (Robert Haas <robertmhaas@gmail.com>)
Список pgsql-hackers
Hi folks

A few times lately I've been doing things in extensions that've made me want to be able to run my own code whenever InterruptPending is true and CHECK_FOR_INTERRUPTS() calls ProcessInterrupts()

So here's a simple patch to add ProcessInterrupts_hook. It follows the usual pattern like ProcessUtility_hook and standard_ProcessUtility.

Why? Because sometimes I want most of the behaviour of die(), but the option to override it with some bgworker-specific choices occasionally. HOLD_INTERRUPTS() is too big a hammer.

What I really want to go along with this is a way for any backend to observe the postmaster's pmState and its "Shutdown" variable's value, so any backend can tell if we're in FastShutdown, SmartShutdown, etc. Copies in shmem only obviously. But I'm not convinced it's right to just copy these vars as-is to shmem, and I don't want to use the memory for a ProcSignal slot for something that won't be relevant for most backends for most of the postmaster lifetime. Ideas welcomed.

Вложения

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

Предыдущее
От: Luc Vlaming
Дата:
Сообщение: Re: New Table Access Methods for Multi and Single Inserts
Следующее
От: Bharath Rupireddy
Дата:
Сообщение: Re: Narrow the scope of the variable outputstr in logicalrep_write_tuple