Andres Freund escribió:
> On 2013-06-20 22:36:45 -0400, Alvaro Herrera wrote:
> > If we leave postmaster running after SIGKILLing its children, the only
> > thing we can do is have it continue to SIGKILL processes continuously
> > every few seconds until they die (or just sit around doing nothing until
> > they all die). I don't think this will have a different effect than
> > postmaster going away trusting the first SIGKILL to do its job
> > eventually.
>
> I think it should just wait till all its child processes are dead. No
> need to repeat sending the signals - as you say, that won't help.
OK, I can buy that. So postmaster stays around waiting in ServerLoop
until all children are gone; and if any persists for whatever reason,
well, tough.
> What we could do to improve the robustness a bit - at least on linux -
> is to prctl(PR_SET_PDEATHSIG, SIGKILL) which would cause children to be
> killed if the postmaster goes away...
This is an interesting idea (even if it has no relationship to the patch
at hand).
--
Álvaro Herrera http://www.2ndQuadrant.com/
PostgreSQL Development, 24x7 Support, Training & Services