diff --git a/src/backend/postmaster/postmaster.c b/src/backend/postmaster/postmaster.c index 9cedc1b9f0..f5a310f844 100644 --- a/src/backend/postmaster/postmaster.c +++ b/src/backend/postmaster/postmaster.c @@ -1732,6 +1732,8 @@ ServerLoop(void) lengthof(events), 0 /* postmaster posts no wait_events */ ); + elog(LOG, "nevents = %d", nevents); + /* * Latch set by signal handler, or new connection pending on any of * our sockets? If the latter, fork a child process to deal with it. @@ -1740,6 +1742,7 @@ ServerLoop(void) { if (events[i].events & WL_LATCH_SET) { + elog(LOG, "events[%i] = WL_LATCH_SET", i); ResetLatch(MyLatch); /* Process work requested via signal handlers. */ @@ -1756,6 +1759,7 @@ ServerLoop(void) { Port *port; + elog(LOG, "events[%i] = WL_SOCKET_ACCEPT", i); port = ConnCreate(events[i].fd); if (port) { @@ -2679,6 +2683,8 @@ handle_pm_reload_request_signal(SIGNAL_ARGS) { int save_errno = errno; + pg_usleep(10000); + pending_pm_reload_request = true; SetLatch(MyLatch); diff --git a/src/backend/storage/ipc/latch.c b/src/backend/storage/ipc/latch.c index d79d71a851..99b0aade1c 100644 --- a/src/backend/storage/ipc/latch.c +++ b/src/backend/storage/ipc/latch.c @@ -1465,6 +1465,9 @@ WaitEventSetWait(WaitEventSet *set, long timeout, break; } + if (set->latch) + pg_usleep(1000000); + /* * Wait for events using the readiness primitive chosen at the top of * this file. If -1 is returned, a timeout has occurred, if 0 we have