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

Commite095013

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 parent855b6f2 commite095013

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
@@ -1429,7 +1429,10 @@ WaitEventSetWaitBlock(WaitEventSet *set, int cur_timeout,
14291429
timeout_p=&timeout;
14301430
}
14311431

1432-
/* Report events discovered by WaitEventAdjustKqueue(). */
1432+
/*
1433+
* Report postmaster events discovered by WaitEventAdjustKqueue() or an
1434+
* earlier call to WaitEventSetWait().
1435+
*/
14331436
if (unlikely(set->report_postmaster_not_running))
14341437
{
14351438
if (set->exit_on_postmaster_death)
@@ -1500,6 +1503,13 @@ WaitEventSetWaitBlock(WaitEventSet *set, int cur_timeout,
15001503
cur_kqueue_event->filter==EVFILT_PROC&&
15011504
(cur_kqueue_event->fflags&NOTE_EXIT)!=0)
15021505
{
1506+
/*
1507+
* The kernel will tell this kqueue object only once about the exit
1508+
* of the postmaster, so let's remember that for next time so that
1509+
* we provide level-triggered semantics.
1510+
*/
1511+
set->report_postmaster_not_running= true;
1512+
15031513
if (set->exit_on_postmaster_death)
15041514
proc_exit(1);
15051515
occurred_events->fd=PGINVALID_SOCKET;

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp