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

Commitb94109c

Browse files
committed
Make WL_POSTMASTER_DEATH level-triggered on kqueue builds.
If WaitEventSetWait() reports that the postmaster has gone away, latercalls to WaitEventSetWait() should continue to report that. Otherwisefurther waits that occur in the proc_exit() path after we alreadynoticed the postmaster's demise could block forever.Back-patch to 13, where the kqueue support landed.Reported-by: Tom Lane <tgl@sss.pgh.pa.us>Discussion:https://postgr.es/m/3624029.1602701929%40sss.pgh.pa.us
1 parenta04daa9 commitb94109c

File tree

1 file changed

+11
-1
lines changed

1 file changed

+11
-1
lines changed

‎src/backend/storage/ipc/latch.c

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1492,7 +1492,10 @@ WaitEventSetWaitBlock(WaitEventSet *set, int cur_timeout,
14921492
timeout_p=&timeout;
14931493
}
14941494

1495-
/* Report events discovered by WaitEventAdjustKqueue(). */
1495+
/*
1496+
* Report postmaster events discovered by WaitEventAdjustKqueue() or an
1497+
* earlier call to WaitEventSetWait().
1498+
*/
14961499
if (unlikely(set->report_postmaster_not_running))
14971500
{
14981501
if (set->exit_on_postmaster_death)
@@ -1563,6 +1566,13 @@ WaitEventSetWaitBlock(WaitEventSet *set, int cur_timeout,
15631566
cur_kqueue_event->filter==EVFILT_PROC&&
15641567
(cur_kqueue_event->fflags&NOTE_EXIT)!=0)
15651568
{
1569+
/*
1570+
* The kernel will tell this kqueue object only once about the exit
1571+
* of the postmaster, so let's remember that for next time so that
1572+
* we provide level-triggered semantics.
1573+
*/
1574+
set->report_postmaster_not_running= true;
1575+
15661576
if (set->exit_on_postmaster_death)
15671577
proc_exit(1);
15681578
occurred_events->fd=PGINVALID_SOCKET;

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp