What (not) to do in signal handlers

Поиск
Список
Период
Сортировка
От Peter Eisentraut
Тема What (not) to do in signal handlers
Дата
Msg-id Pine.LNX.4.30.0106141912400.2008-100000@peter.localdomain
обсуждение исходный текст
Ответы Re: What (not) to do in signal handlers  (Bruce Momjian <pgman@candle.pha.pa.us>)
Re: What (not) to do in signal handlers  (Tom Lane <tgl@sss.pgh.pa.us>)
Список pgsql-hackers
I notice that the signal handlers in postmaster.c do quite a lot of work,
much more than what they teach you in school they should do.  While
fprintf, elog, and ctime may simply lead to annoyances, forking off the
WAL helper processes seems to be quite a lot.

ISTM that most of these, esp. pmdie(), can be written more like the SIGHUP
handler, i.e., set a global variable and evaluate right after the
select().  This would at least give me a better feeling when I send "Fast
Shutdown request at %s" etc. through elog(), which is what they should do
for consistent message formatting.

Comments?

-- 
Peter Eisentraut   peter_e@gmx.net   http://funkturm.homeip.net/~peter



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

Предыдущее
От: Bruce Momjian
Дата:
Сообщение: Re: remote database queries
Следующее
От: Bruce Momjian
Дата:
Сообщение: Re: What (not) to do in signal handlers