Location via proxy:   [ UP ]  
[Report a bug]   [Manage cookies]                
Skip to content

Commit f6feb8e

Browse files
committed
Stop bgworkers during fast shutdown with postmaster in startup phase
When a postmaster gets into its phase PM_STARTUP, it would start background workers using BgWorkerStart_PostmasterStart mode immediately, which would cause problems for a fast shutdown as the postmaster forgets to send SIGTERM to already-started background workers. With smart and immediate shutdowns, this correctly happened, and fast shutdown is the only mode missing the shot. Author: Alexander Kukushkin Reviewed-by: Michael Paquier Discussion: https://postgr.es/m/CAFh8B=mvnD8+DZUfzpi50DoaDfZRDfd7S=gwj5vU9GYn8UvHkA@mail.gmail.com Backpatch-through: 9.5
1 parent 97aa524 commit f6feb8e

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/backend/postmaster/postmaster.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2686,7 +2686,7 @@ pmdie(SIGNAL_ARGS)
26862686
signal_child(BgWriterPID, SIGTERM);
26872687
if (WalReceiverPID != 0)
26882688
signal_child(WalReceiverPID, SIGTERM);
2689-
if (pmState == PM_RECOVERY)
2689+
if (pmState == PM_STARTUP || pmState == PM_RECOVERY)
26902690
{
26912691
SignalSomeChildren(SIGTERM, BACKEND_TYPE_BGWORKER);
26922692

0 commit comments

Comments
 (0)