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 BANLkTimQnUCL_eB8kbO8wTTdkNjkDb1rsw@mail.gmail.com
Whole thread Raw
In response to Re: Latch implementation that wakes on postmaster death on both win32 and Unix  (Fujii Masao <masao.fujii@gmail.com>)
Responses Re: Latch implementation that wakes on postmaster death on both win32 and Unix
List pgsql-hackers
On 24 June 2011 12:30, Fujii Masao <masao.fujii@gmail.com> wrote:
> +#ifndef WIN32
> +       /*
> +        * Initialise mechanism that allows waiting latch clients
> +        * to wake on postmaster death, to finish their
> +        * remaining business
> +        */
> +       InitPostmasterDeathWatchHandle();
> +#endif
>
> Calling this function before creating TopMemoryContext looks unsafe. What if
> the function calls ereport(FATAL)?
>
> That ereport() can be called before postgresql.conf is read, i.e., before GUCs
> for error reporting are set. Is this OK? If not,
> InitPostmasterDeathWatchHandle()
> should be moved after SelectConfigFiles().

I see no reason to take the risk that it might at some point - I've moved it.

> +#ifndef WIN32
> +int postmaster_alive_fds[2];
> +#endif
>
> postmaster_alive_fds[] should be initialized to "{-1, -1}"?

Yes, they should. That works better.

I think that Heikki is currently taking another look at my work,
because he indicates in a new message to the list a short time ago
that while reviewing my patch, he realised that there may be an
independent problem with silent_mode. I will wait for his remarks
before producing another version of the patch that incorporates those
two small changes.

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


pgsql-hackers by date:

Previous
From: Fujii Masao
Date:
Subject: Re: Latch implementation that wakes on postmaster death on both win32 and Unix
Next
From: Steve Singer
Date:
Subject: Re: Online base backup from the hot-standby