[pgpool-hackers: 56] Re: [pgpool-II 0000009]: dont call syslog(3) family in signal handler.

Tatsuo Ishii ishii at postgresql.org
Sat Mar 31 18:26:18 JST 2012


>> Quick loook by using "grep RETSIGTYPE" reveleas that there are number
>> of placess where pool_log etc. get called in a signal handler. This is
>> not the whole story of course. Even there's no pool_log calls, it is
>> possible that a function called in a signal handler calls pool_log.
>>
>> I think the only solution is, pool_log does not call syslog if called
>> in a signal handler. However I could find a way for a function to know
>> if it is called within a signal handler. What about setting a global
>> flag at the beginning of a signal handler. When pool_log is called and
>> if it finds the flag being set, it does not call syslog.
> 
> A common workaround on syslog or other non signal safe function issue is
> to block signals before calling vsyslog functions and unblock them
> after. Looking at the pool_error.c file this was already done but syslog
> functions call are done before the signal blocking, my bad. Here is a
> patch that should fix the problem.

Thanks. I forgot about the solution. Will commit.
--
Tatsuo Ishii
SRA OSS, Inc. Japan
English: http://www.sraoss.co.jp/index_en.php
Japanese: http://www.sraoss.co.jp


More information about the pgpool-hackers mailing list