Re: pgsql: Improve tests for postmaster death in auxiliary processes.

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: Peter Geoghegan <peter(at)2ndquadrant(dot)com>
Cc: pgsql-committers(at)postgresql(dot)org
Subject: Re: pgsql: Improve tests for postmaster death in auxiliary processes.
Date: 2012-05-10 15:19:41
Message-ID: 1194.1336663181@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-committers

Peter Geoghegan <peter(at)2ndquadrant(dot)com> writes:
> On 10 May 2012 05:55, Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us> wrote:
>> I had already removed the unconditional
>> PostmasterIsAlive calls in bgwriter and pgstat in previous patches, but
>> forgot that WL_POSTMASTER_DEATH is supposed to be treated as untrustworthy
>> (per comment in unix_latch.c); so adjust those two cases to match.

> I'm not sure why we're pushing the responsibility to call
> PostmasterIsAlive() onto latch clients. Why not just do it within
> WaitLatchOrSocket just as the WL_POSTMASTER_DEATH bit is set? It's not
> as if someone could conceivably care that the Postmaster might have
> died, but not enough to want to be sure.

Hmm ... yeah, that would simplify the API if we didn't have to have the
caveat about the bits being untrustworthy. The only objection I can see
is that this might represent a useless PostmasterIsAlive call for those
callers that aren't inspecting the result bit. However, at this point
we've more or less decided that those callers aren't
performance-critical anyway; anyone who thinks they are should be
rearranging their code to remove the separate PostmasterIsAlive calls.

So, yeah, seems like a good idea. Any objections out there?

regards, tom lane

In response to

Browse pgsql-committers by date

  From Date Subject
Next Message Bruce Momjian 2012-05-10 15:21:23 pgsql: Release notes adjustments from Erik Rijkers
Previous Message Peter Geoghegan 2012-05-10 15:08:17 Re: pgsql: Improve tests for postmaster death in auxiliary processes.