Re: What (not) to do in signal handlers

Поиск
Список
Период
Сортировка
От Bruce Momjian
Тема Re: What (not) to do in signal handlers
Дата
Msg-id 200106141751.f5EHpGn13841@candle.pha.pa.us
обсуждение исходный текст
Ответ на What (not) to do in signal handlers  (Peter Eisentraut <peter_e@gmx.net>)
Список 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.

Agreed.  If we don't loop around to check the variable soon we have
bigger problems that the signal handlers.

--  Bruce Momjian                        |  http://candle.pha.pa.us pgman@candle.pha.pa.us               |  (610)
853-3000+  If your life is a hard drive,     |  830 Blythe Avenue +  Christ can be your backup.        |  Drexel Hill,
Pennsylvania19026
 


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

Предыдущее
От: Peter Eisentraut
Дата:
Сообщение: What (not) to do in signal handlers
Следующее
От: Tom Lane
Дата:
Сообщение: Re: Doing authentication in backend