*/
Assert(Shutdown > NoShutdown);
+ elog(LOG, "checkpointer dead at %s",
+ current_time_as_str());
+
/* Waken archiver for the last time */
if (PgArchPID != 0)
signal_child(PgArchPID, SIGUSR2);
if (ReachedNormalRunning)
CancelBackup();
+ elog(LOG, "all children dead at %s",
+ current_time_as_str());
+
/* Normal exit from the postmaster is here */
ExitPostmaster(0);
}
void
proc_exit(int code)
{
+ bool noisy = AmCheckpointerProcess() || (getpid() == PostmasterPid);
+
/* Clean up everything that must be cleaned up */
proc_exit_prepare(code);
elog(DEBUG3, "exit(%d)", code);
+ if (noisy)
+ elog(LOG, "calling exit(%d) at %s",
+ code, current_time_as_str());
+
exit(code);
}
static void
proc_exit_prepare(int code)
{
+ bool noisy = AmCheckpointerProcess() || (getpid() == PostmasterPid);
+
/*
* Once we set this flag, we are committed to exit. Any ereport() will
* NOT send control back to the main loop, but right back here.
* possible.
*/
while (--on_proc_exit_index >= 0)
+ {
+ if (noisy)
+ elog(LOG, "doing on_proc_exit %d at %s",
+ on_proc_exit_index, current_time_as_str());
(*on_proc_exit_list[on_proc_exit_index].function) (code,
on_proc_exit_list[on_proc_exit_index].arg);
+ }
on_proc_exit_index = 0;
}
void
shmem_exit(int code)
{
+ bool noisy = AmCheckpointerProcess() || (getpid() == PostmasterPid);
+
/*
* Call before_shmem_exit callbacks.
*
elog(DEBUG3, "shmem_exit(%d): %d before_shmem_exit callbacks to make",
code, before_shmem_exit_index);
while (--before_shmem_exit_index >= 0)
+ {
+ if (noisy)
+ elog(LOG, "doing before_shmem_exit %d at %s",
+ before_shmem_exit_index, current_time_as_str());
(*before_shmem_exit_list[before_shmem_exit_index].function) (code,
before_shmem_exit_list[before_shmem_exit_index].arg);
+ }
before_shmem_exit_index = 0;
/*
elog(DEBUG3, "shmem_exit(%d): %d on_shmem_exit callbacks to make",
code, on_shmem_exit_index);
while (--on_shmem_exit_index >= 0)
+ {
+ if (noisy)
+ elog(LOG, "doing on_shmem_exit %d at %s",
+ on_shmem_exit_index, current_time_as_str());
(*on_shmem_exit_list[on_shmem_exit_index].function) (code,
on_shmem_exit_list[on_shmem_exit_index].arg);
+ }
on_shmem_exit_index = 0;
}