Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commiteee6cf1

Browse files
committed
When a bgworker exits, always call ReleasePostmasterChildSlot.
Commite2ce9aa was insufficientlywell thought out. Repair.
1 parent970d1f7 commiteee6cf1

File tree

1 file changed

+12
-10
lines changed

1 file changed

+12
-10
lines changed

‎src/backend/postmaster/postmaster.c

Lines changed: 12 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -2856,23 +2856,25 @@ CleanupBackgroundWorker(int pid,
28562856
* backend, any exit status other than 0 or 1 is considered a crash
28572857
* and causes a system-wide restart.
28582858
*/
2859-
if (rw->rw_worker.bgw_flags&BGWORKER_SHMEM_ACCESS)
2859+
if ((rw->rw_worker.bgw_flags&BGWORKER_SHMEM_ACCESS)!=0)
28602860
{
28612861
if (!EXIT_STATUS_0(exitstatus)&& !EXIT_STATUS_1(exitstatus))
28622862
{
28632863
HandleChildCrash(pid,exitstatus,namebuf);
28642864
return true;
28652865
}
2866+
}
28662867

2867-
if (!ReleasePostmasterChildSlot(rw->rw_child_slot))
2868-
{
2869-
/*
2870-
* Uh-oh, the child failed to clean itself up. Treat as a
2871-
* crash after all.
2872-
*/
2873-
HandleChildCrash(pid,exitstatus,namebuf);
2874-
return true;
2875-
}
2868+
/*
2869+
* We must release the postmaster child slot whether this worker
2870+
* is connected to shared memory or not, but we only treat it as
2871+
* a crash if it is in fact connected.
2872+
*/
2873+
if (!ReleasePostmasterChildSlot(rw->rw_child_slot)&&
2874+
(rw->rw_worker.bgw_flags&BGWORKER_SHMEM_ACCESS)!=0)
2875+
{
2876+
HandleChildCrash(pid,exitstatus,namebuf);
2877+
return true;
28762878
}
28772879

28782880
/* Get it out of the BackendList and clear out remaining data */

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp