Re: [GENERAL] Shutting down a warm standby database in 8.2beta3 - Mailing list pgsql-hackers

From Tom Lane
Subject Re: [GENERAL] Shutting down a warm standby database in 8.2beta3
Date
Msg-id 24322.1163821779@sss.pgh.pa.us
Whole thread Raw
In response to Re: [GENERAL] Shutting down a warm standby database in 8.2beta3  (Stephen Harris <lists@spuddy.org>)
Responses Re: [GENERAL] Shutting down a warm standby database in 8.2beta3  (Stephen Harris <lists@spuddy.org>)
List pgsql-hackers
Stephen Harris <lists@spuddy.org> writes:
> However, it seems the signal wasn't sent at all.

Now that I think about it, the behavior of system() is predicated on the
assumption that SIGINT and SIGQUIT originate with the tty driver and are
broadcast to all members of the session's process group --- so the
called command will get them too, and there's no need for system() to
do anything except wait to see whether the called command dies or traps
the signal.

This does not apply to signals originated by the postmaster --- it
doesn't even know that the child process is doing a system(), much less
have any way to signal the grandchild.  Ugh.

Reimplementing system() seems pretty ugly, but maybe we have no choice.
It strikes me that system() has a race condition as defined anyway,
because if a signal arrives between blocking the handler and issuing the
fork(), it'll disappear into the ether; and the same at the end of the
routine.
        regards, tom lane


pgsql-hackers by date:

Previous
From: "Andrew Dunstan"
Date:
Subject: Re: [COMMITTERS] pgsql: Clarify description of
Next
From: Stephen Harris
Date:
Subject: Re: [GENERAL] Shutting down a warm standby database in 8.2beta3