Postmaster doesn't send SIGTERM to bgworker during fast shutdown whenpmState == PM_STARTUP - Mailing list pgsql-hackers

From Alexander Kukushkin
Subject Postmaster doesn't send SIGTERM to bgworker during fast shutdown whenpmState == PM_STARTUP
Date
Msg-id CAFh8B=mvnD8+DZUfzpi50DoaDfZRDfd7S=gwj5vU9GYn8UvHkA@mail.gmail.com
Whole thread Raw
Responses Re: Postmaster doesn't send SIGTERM to bgworker during fast shutdownwhen pmState == PM_STARTUP
List pgsql-hackers
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 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.


Regards,
--
Alexander Kukushkin

Attachment

pgsql-hackers by date:

Previous
From: David Rowley
Date:
Subject: Small patch to remove some duplicate words in comments
Next
From: Tom Lane
Date:
Subject: Multiple reporting of syslogger errors