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

2018-08-29 Thread Michael Paquier
On Wed, Aug 29, 2018 at 09:09:08AM +0200, Alexander Kukushkin wrote: > Yeah, good catch, it starts checkpointer, bgwriter and in some cases > even archiver processes (when archive_mode=always) while pmState is > still equaled PM_START. > Please find attached the new version of the fix. Thanks,

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

2018-08-29 Thread Alexander Kukushkin
Hi, 2018-08-29 1:24 GMT+02:00 Michael Paquier : > I have been studying your patch, but it seems to me that this is not > complete as other processes could have been started before switching > from PM_STARTUP to PM_RECOVERY. I am talking here about the bgwriter > and the checkpointer as well.

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

2018-08-28 Thread Michael Paquier
On Mon, Aug 27, 2018 at 07:34:55PM -0700, Michael Paquier wrote: > 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

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

2018-08-27 Thread Michael Paquier
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 >

Postmaster doesn't send SIGTERM to bgworker during fast shutdown when pmState == PM_STARTUP

2018-08-26 Thread Alexander Kukushkin
Hello hackers, it is possible to start bgworker with bgw_start_time = BgWorkerStart_PostmasterStart, which will be started immediately after postmaster. 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