Re: [GENERAL] Shutting down a warm standby database in 8.2beta3

Поиск
Список
Период
Сортировка
От Tom Lane
Тема Re: [GENERAL] Shutting down a warm standby database in 8.2beta3
Дата
Msg-id 24322.1163821779@sss.pgh.pa.us
обсуждение исходный текст
Ответ на Re: [GENERAL] Shutting down a warm standby database in 8.2beta3  (Stephen Harris <lists@spuddy.org>)
Ответы Re: [GENERAL] Shutting down a warm standby database in 8.2beta3  (Stephen Harris <lists@spuddy.org>)
Список 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 по дате отправления:

Предыдущее
От: "Andrew Dunstan"
Дата:
Сообщение: Re: [COMMITTERS] pgsql: Clarify description of
Следующее
От: Stephen Harris
Дата:
Сообщение: Re: [GENERAL] Shutting down a warm standby database in 8.2beta3