What (not) to do in signal handlers

From: Peter Eisentraut <peter_e(at)gmx(dot)net>
To: PostgreSQL Development <pgsql-hackers(at)postgresql(dot)org>
Subject: What (not) to do in signal handlers
Date: 2001-06-14 17:39:18
Message-ID: Pine.LNX.4.30.0106141912400.2008-100000@peter.localdomain
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: 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(at)gmx(dot)net http://funkturm.homeip.net/~peter

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Tom Lane 2001-06-14 17:42:26 Re: Doing authentication in backend
Previous Message Bruce Momjian 2001-06-14 17:25:37 Re: Removal of temp tables