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.c23
1 files changed, 9 insertions, 14 deletions
diff --git a/src/backend/postmaster/postmaster.c b/src/backend/postmaster/postmaster.c
index fc0bc8d99ee..9c2c98614aa 100644
--- a/src/backend/postmaster/postmaster.c
+++ b/src/backend/postmaster/postmaster.c
@@ -3302,26 +3302,21 @@ CleanupBackgroundWorker(int pid,
}
/*
- * Additionally, for shared-memory-connected workers, just like a
- * backend, any exit status other than 0 or 1 is considered a crash
- * and causes a system-wide restart.
+ * Additionally, just like a backend, any exit status other than 0 or
+ * 1 is considered a crash and causes a system-wide restart.
*/
- if ((rw->rw_worker.bgw_flags & BGWORKER_SHMEM_ACCESS) != 0)
+ if (!EXIT_STATUS_0(exitstatus) && !EXIT_STATUS_1(exitstatus))
{
- if (!EXIT_STATUS_0(exitstatus) && !EXIT_STATUS_1(exitstatus))
- {
- HandleChildCrash(pid, exitstatus, namebuf);
- return true;
- }
+ HandleChildCrash(pid, exitstatus, namebuf);
+ return true;
}
/*
- * We must release the postmaster child slot whether this worker is
- * connected to shared memory or not, but we only treat it as a crash
- * if it is in fact connected.
+ * We must release the postmaster child slot. If the worker failed to
+ * do so, it did not clean up after itself, requiring a crash-restart
+ * cycle.
*/
- if (!ReleasePostmasterChildSlot(rw->rw_child_slot) &&
- (rw->rw_worker.bgw_flags & BGWORKER_SHMEM_ACCESS) != 0)
+ if (!ReleasePostmasterChildSlot(rw->rw_child_slot))
{
HandleChildCrash(pid, exitstatus, namebuf);
return true;