Re: Postmaster doesn't send SIGTERM to bgworker during fast shutdownwhen pmState == PM_STARTUP

Поиск
Список
Период
Сортировка
От Michael Paquier
Тема Re: Postmaster doesn't send SIGTERM to bgworker during fast shutdownwhen pmState == PM_STARTUP
Дата
Msg-id 20180828023136.GE5553@paquier.xyz
обсуждение исходный текст
Ответ на Postmaster doesn't send SIGTERM to bgworker during fast shutdown whenpmState == PM_STARTUP  (Alexander Kukushkin <cyberdemn@gmail.com>)
Ответы Re: Postmaster doesn't send SIGTERM to bgworker during fast shutdownwhen pmState == PM_STARTUP
Список pgsql-hackers
On Sun, Aug 26, 2018 at 06:00:23PM +0200, Alexander Kukushkin wrote:
> it is possible to start bgworker with bgw_start_time =
> BgWorkerStart_PostmasterStart, which will be started immediately after
> postmaster.

Right.

> But if you try to do a fast shutdown while postmaster still in the
> pmState == PM_STARTUP, bgworker will never get SIGTERM and postmaster
> will wait forever.
> At the same time, if you do immediate or smart shutdown, it works fine.
>
> The problem is in the pmdie function. Proposed fix attached.

That seems like a good catch and a correct fix to me.  The handling of
SIGINT is inconsistent with SIGTERM in pmdie().  I would just add a
comment to mention that at this stage only the startup process is
running, and that it has been signaled already.  I'll commit that
tomorrow.
--
Michael

Вложения

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

Предыдущее
От: Tom Lane
Дата:
Сообщение: Re: Why hash OIDs?
Следующее
От: Michael Paquier
Дата:
Сообщение: Re: [HACKERS] Proposal to add work_mem option to postgres_fdw module