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