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

Commite2ce9aa

Browse files
committed
Never crash-and-restart for bgworkers without shared memory access.
The motivation for a crash and restart cycle when a backend dies isthat it might have corrupted shared memory on the way down; and wecan't recover reliably except by reinitializing everything. But thatdoesn't apply to processes that don't touch shared memory. Currently,there's nothing to prevent a background worker that doesn't requestshared memory access from touching shared memory anyway, but that's aseparate bug.Previous to this commit, the coding in postmaster.c was inconsistent:an exit status other than 0 or 1 didn't provoke a crash-and-restart,but failure to release the postmaster child slot did. This changemakes those cases consistent.
1 parent1891b41 commite2ce9aa

File tree

1 file changed

+10
-10
lines changed

1 file changed

+10
-10
lines changed

‎src/backend/postmaster/postmaster.c

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -2864,17 +2864,17 @@ CleanupBackgroundWorker(int pid,
28642864
HandleChildCrash(pid,exitstatus,namebuf);
28652865
return true;
28662866
}
2867-
}
28682867

2869-
if (!ReleasePostmasterChildSlot(rw->rw_child_slot))
2870-
{
2871-
/*
2872-
* Uh-oh, the child failed to clean itself up. Treat as a crash
2873-
* after all.
2874-
*/
2875-
rw->rw_crashed_at=GetCurrentTimestamp();
2876-
HandleChildCrash(pid,exitstatus,namebuf);
2877-
return true;
2868+
if (!ReleasePostmasterChildSlot(rw->rw_child_slot))
2869+
{
2870+
/*
2871+
* Uh-oh, the child failed to clean itself up. Treat as a
2872+
* crash after all.
2873+
*/
2874+
rw->rw_crashed_at=GetCurrentTimestamp();
2875+
HandleChildCrash(pid,exitstatus,namebuf);
2876+
return true;
2877+
}
28782878
}
28792879

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

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp