Commit b7b5a189 authored by Tom Lane's avatar Tom Lane

In pg_ctl, report unexpected failure to stat() the postmaster.pid file.

Any error other than ENOENT is a bit suspicious here, and perhaps should
not be grounds for assuming the postmaster has failed.  For the moment
though, just report it, and don't change the behavior otherwise.  The
intent is mainly to try to determine why we are seeing intermittent
failures in this area on some buildfarm members.

Back-patch to 9.5 where some of these failures have happened.
parent 158d6153
...@@ -648,7 +648,12 @@ test_postmaster_connection(bool do_checkpoint) ...@@ -648,7 +648,12 @@ test_postmaster_connection(bool do_checkpoint)
struct stat statbuf; struct stat statbuf;
if (stat(pid_file, &statbuf) != 0) if (stat(pid_file, &statbuf) != 0)
{
if (errno != ENOENT)
write_stderr(_("\n%s: could not stat file \"%s\": %s\n"),
progname, pid_file, strerror(errno));
return PQPING_NO_RESPONSE; return PQPING_NO_RESPONSE;
}
if (found_stale_pidfile) if (found_stale_pidfile)
{ {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment