summaryrefslogtreecommitdiff
path: root/src/backend/postmaster/postmaster.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/backend/postmaster/postmaster.c')
-rw-r--r--src/backend/postmaster/postmaster.c10
1 files changed, 9 insertions, 1 deletions
diff --git a/src/backend/postmaster/postmaster.c b/src/backend/postmaster/postmaster.c
index 98086f7841..351887b133 100644
--- a/src/backend/postmaster/postmaster.c
+++ b/src/backend/postmaster/postmaster.c
@@ -1463,7 +1463,8 @@ DetermineSleepTime(struct timeval * timeout)
if (rw->rw_crashed_at == 0)
continue;
- if (rw->rw_worker.bgw_restart_time == BGW_NEVER_RESTART)
+ if (rw->rw_worker.bgw_restart_time == BGW_NEVER_RESTART
+ || rw->rw_terminate)
{
ForgetBackgroundWorker(&siter);
continue;
@@ -5471,6 +5472,13 @@ maybe_start_bgworker(void)
if (rw->rw_pid != 0)
continue;
+ /* marked for death? */
+ if (rw->rw_terminate)
+ {
+ ForgetBackgroundWorker(&iter);
+ continue;
+ }
+
/*
* If this worker has crashed previously, maybe it needs to be
* restarted (unless on registration it specified it doesn't want to