summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTom Lane <tgl@sss.pgh.pa.us>2015-07-25 15:58:14 -0400
committerTom Lane <tgl@sss.pgh.pa.us>2015-07-25 15:58:14 -0400
commit87221867e8b8fedb347e32d3d919e62ae85edc81 (patch)
tree9c932982b3b584d3cc0480f02d92a686d470aeb5
parent68c3549fb56834f47d57ef010ffbd3bdbd80b941 (diff)
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.
-rw-r--r--src/bin/pg_ctl/pg_ctl.c5
1 files changed, 5 insertions, 0 deletions
diff --git a/src/bin/pg_ctl/pg_ctl.c b/src/bin/pg_ctl/pg_ctl.c
index 74764fabdaf..6a36d29f43b 100644
--- a/src/bin/pg_ctl/pg_ctl.c
+++ b/src/bin/pg_ctl/pg_ctl.c
@@ -648,7 +648,12 @@ test_postmaster_connection(bool do_checkpoint)
struct stat statbuf;
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;
+ }
if (found_stale_pidfile)
{