Re: Archiver not exiting upon crash

Поиск
Список
Период
Сортировка
От Tom Lane
Тема Re: Archiver not exiting upon crash
Дата
Msg-id 11658.1337805909@sss.pgh.pa.us
обсуждение исходный текст
Ответ на Re: Archiver not exiting upon crash  (Jeff Janes <jeff.janes@gmail.com>)
Ответы Re: Archiver not exiting upon crash  (Tom Lane <tgl@sss.pgh.pa.us>)
Список pgsql-hackers
Jeff Janes <jeff.janes@gmail.com> writes:
> On Wed, May 23, 2012 at 1:10 PM, Tom Lane <tgl@sss.pgh.pa.us> wrote:
>> On my machine, man system(3) saith:
>> 
>>     system() ignores the SIGINT and SIGQUIT signals, and blocks the
>>     SIGCHLD signal, while waiting for the command to terminate.  If this
>>     might cause the application to miss a signal that would have killed
>>     it, the application should examine the return value from system() and
>>     take whatever action is appropriate to the application if the command
>>     terminated due to receipt of a signal.

> But what happens if the SIGQUIT is blocked before the system(3) is
> invoked?  Does the ignore take precedence over the block, or does the
> block take precedence over the ignore, and so the signal is still
> waiting once the block is reversed after the system(3) is over?  I
> could write a test program to see, but that wouldn't be very good
> evidence of the portability.

AFAICT from the POSIX spec for system(3), that would be a bug in
system().  You are supposed to be able to tell from the return value
whether a signal happened.  Note that the signals are only supposed to
be ignored while waiting for the command to terminate; therefore, if
a signal does get ignored in the parent process, it should be delivered
to the child, and so we should see its effects in the child's return
code.

Of course, if you are using an archive_command that might itself ignore
SIGQUIT, perhaps that's where the issue is.
        regards, tom lane


В списке pgsql-hackers по дате отправления:

Предыдущее
От: Jeff Janes
Дата:
Сообщение: Re: Archiver not exiting upon crash
Следующее
От: Simon Riggs
Дата:
Сообщение: Re: Changing the concept of a DATABASE