Re: What is the best and easiest implementation to reliably wait for the completion of startup?

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: "MauMau" <maumau307(at)gmail(dot)com>
Cc: pgsql-hackers(at)postgresql(dot)org
Subject: Re: What is the best and easiest implementation to reliably wait for the completion of startup?
Date: 2011-05-27 14:34:53
Message-ID: 12493.1306506893@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

"MauMau" <maumau307(at)gmail(dot)com> writes:
> The bad thing is that pg_ctl continues to wait until the specified duration
> passes, even if postgres fails to start. For example, it is naturally
> desirable for pg_ctl to terminate when postgresql.conf contains a syntax
> error.

Hmm, I thought we'd fixed this in the last go-round of pg_ctl wait
revisions, but testing proves it does not work desirably in HEAD:
not only does pg_ctl wait till its timeout elapses, but it then reports
"server started" even though the server didn't start. That's clearly a
bug :-(

I think your proposal of a pipe-based solution might be overkill though.
Seems like it would be sufficient for pg_ctl to give up if it doesn't
see the postmaster.pid file present within a couple of seconds of
postmaster startup. I don't really want to add logic to the postmaster
to have the sort of reporting protocol you propose, because not
everybody uses pg_ctl to start the postmaster. In any case, we need a
fix in 9.1 ...

regards, tom lane

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Cédric Villemain 2011-05-27 14:38:22 Re: Vacuum, visibility maps and SKIP_PAGES_THRESHOLD
Previous Message Heikki Linnakangas 2011-05-27 14:11:17 Re: Vacuum, visibility maps and SKIP_PAGES_THRESHOLD