]> granicus.if.org Git - postgresql/commit
Improve corner cases in pg_ctl's new wait-for-postmaster-startup code.
authorTom Lane <tgl@sss.pgh.pa.us>
Fri, 27 May 2011 18:13:38 +0000 (14:13 -0400)
committerTom Lane <tgl@sss.pgh.pa.us>
Fri, 27 May 2011 18:13:38 +0000 (14:13 -0400)
commit0bae3bc9be4a025df089f0a0c2f547fa538a97bc
treeffff2221aac49de5774db989178229b0a36104a8
parent90857b48e1f69dbca52f498bd444190d36dbd73f
Improve corner cases in pg_ctl's new wait-for-postmaster-startup code.

With "-w -t 0", we should report "still starting up", not "ok".  If we
fall out of the loop without ever being able to call PQping (because we
were never able to construct a connection string), report "no response",
not "ok".  This gets rid of corner cases in which we'd claim the server
had started even though it had not.

Also, if the postmaster.pid file is not there at any point after we've
waited 5 seconds, assume the postmaster has failed and report that, rather
than almost-certainly-fruitlessly continuing to wait.  The pidfile should
appear almost instantly even when there is extensive startup work to do,
so 5 seconds is already a very conservative figure.  This part is per a
gripe from MauMau --- there might be better ways to do it, but nothing
simple enough to get done for 9.1.
src/bin/pg_ctl/pg_ctl.c