From: Peter Eisentraut Date: Sat, 3 Jun 2017 03:02:13 +0000 (-0400) Subject: Ignore WL_POSTMASTER_DEATH latch event in single user mode X-Git-Tag: REL_10_BETA2~228 X-Git-Url: http://git.postgresql.org/gitweb/?a=commitdiff_plain;h=06bfb801c73c89e66f44c1cf693386793e98b637;p=postgresql.git Ignore WL_POSTMASTER_DEATH latch event in single user mode Otherwise code that uses this will abort with an assertion failure, because postmaster_alive_fds are not initialized. Reported-by: tushar --- diff --git a/src/backend/storage/ipc/latch.c b/src/backend/storage/ipc/latch.c index 53e6bf2477d..55959de91f3 100644 --- a/src/backend/storage/ipc/latch.c +++ b/src/backend/storage/ipc/latch.c @@ -370,7 +370,7 @@ WaitLatchOrSocket(volatile Latch *latch, int wakeEvents, pgsocket sock, AddWaitEventToSet(set, WL_LATCH_SET, PGINVALID_SOCKET, (Latch *) latch, NULL); - if (wakeEvents & WL_POSTMASTER_DEATH) + if (wakeEvents & WL_POSTMASTER_DEATH && IsUnderPostmaster) AddWaitEventToSet(set, WL_POSTMASTER_DEATH, PGINVALID_SOCKET, NULL, NULL);