aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/backend/postmaster/postmaster.c23
1 files changed, 12 insertions, 11 deletions
diff --git a/src/backend/postmaster/postmaster.c b/src/backend/postmaster/postmaster.c
index ac18c41178c..91f8418da8d 100644
--- a/src/backend/postmaster/postmaster.c
+++ b/src/backend/postmaster/postmaster.c
@@ -1596,8 +1596,7 @@ ServerLoop(void)
{
fd_set readmask;
int nSockets;
- time_t now,
- last_lockfile_recheck_time,
+ time_t last_lockfile_recheck_time,
last_touch_time;
last_lockfile_recheck_time = last_touch_time = time(NULL);
@@ -1608,6 +1607,7 @@ ServerLoop(void)
{
fd_set rmask;
int selres;
+ time_t now;
/*
* Wait for a connection request to arrive.
@@ -1760,6 +1760,16 @@ ServerLoop(void)
#endif
/*
+ * Lastly, check to see if it's time to do some things that we don't
+ * want to do every single time through the loop, because they're a
+ * bit expensive. Note that there's up to a minute of slop in when
+ * these tasks will be performed, since DetermineSleepTime() will let
+ * us sleep at most that long; except for SIGKILL timeout which has
+ * special-case logic there.
+ */
+ now = time(NULL);
+
+ /*
* If we already sent SIGQUIT to children and they are slow to shut
* down, it's time to send them SIGKILL. This doesn't happen
* normally, but under certain conditions backends can get stuck while
@@ -1778,15 +1788,6 @@ ServerLoop(void)
}
/*
- * Lastly, check to see if it's time to do some things that we don't
- * want to do every single time through the loop, because they're a
- * bit expensive. Note that there's up to a minute of slop in when
- * these tasks will be performed, since DetermineSleepTime() will let
- * us sleep at most that long.
- */
- now = time(NULL);
-
- /*
* Once a minute, verify that postmaster.pid hasn't been removed or
* overwritten. If it has, we force a shutdown. This avoids having
* postmasters and child processes hanging around after their database