Re: Latch implementation that wakes on postmaster death on both win32 and Unix - Mailing list pgsql-hackers

From Peter Geoghegan
Subject Re: Latch implementation that wakes on postmaster death on both win32 and Unix
Date
Msg-id CAEYLb_U-34JfnvYg9UWx-PJiwQ+Pjf6q6TnN8iz+B5qr-Vn_ig@mail.gmail.com
Whole thread Raw
In response to Re: Latch implementation that wakes on postmaster death on both win32 and Unix  (Robert Haas <robertmhaas@gmail.com>)
Responses Re: Latch implementation that wakes on postmaster death on both win32 and Unix
List pgsql-hackers
On 7 July 2011 19:15, Robert Haas <robertmhaas@gmail.com> wrote:
>> I'm not concerned about the possibility of spurious extra cycles of
>> auxiliary process event loops - should I be?
>
> A tight loop would be bad, but an occasional spurious wake-up seems harmless.

We should also assert !PostmasterIsAlive() from within the latch code
after waking due to apparent Postmaster death. The reason that I don't
want to follow Florian's suggestion to check it in production is that
I don't know what to do if the postmaster turns out to be alive. Why
is it more reasonable to try again than to just return? If the
spurious wake-up thing was a problem that we could actually reproduce,
then maybe I'd have an opinion on it. As it stands, our entire basis
for thinking this may be a problem is the sentence "There may be other
circumstances in which a file descriptor is spuriously reported as
ready". That seems rather flimsy.

Anyone that still has any misgivings about this will probably feel
better once the assertion is never reported to fail on any of the
diverse systems that PostgreSQL will be tested on in advance of the
9.2 release.

--
Peter Geoghegan       http://www.2ndQuadrant.com/
PostgreSQL Development, 24x7 Support, Training and Services


pgsql-hackers by date:

Previous
From: Kyotaro HORIGUCHI
Date:
Subject: Re: make_greater_string() does not return a string in some cases
Next
From: Florian Pflug
Date:
Subject: Re: spinlock contention