Re: SIGCHLD handler in Postgres C function.

Поиск
Список
Период
Сортировка
От Bill Studenmund
Тема Re: SIGCHLD handler in Postgres C function.
Дата
Msg-id Pine.NEB.4.33.0107301546590.324-100000@candlekeep.home-net.internetconnect.net
обсуждение исходный текст
Ответ на Re: SIGCHLD handler in Postgres C function.  (Tom Lane <tgl@sss.pgh.pa.us>)
Список pgsql-hackers
On Mon, 30 Jul 2001, Tom Lane wrote:

> Bill Studenmund <wrstuden@zembu.com> writes:
> > Looking at source on the web, I found:
>
> > kernel/signal.c:1042
>
> > * Note the silly behaviour of SIGCHLD: SIG_IGN means that the
> > * signal isn't actually ignored, but does automatic child
> > * reaping, while SIG_DFL is explicitly said by POSIX to force
> > * the signal to be ignored.
>
> Hmm, interesting.  If you'll recall, the start of this thread was a
> proposal to change our backends' handling of SIGCHLD from SIG_IGN to
> SIG_DFL (and get rid of explicit tests for ECHILD).  I didn't quite see
> why changing the handler should make a difference, but above we seem to
> have the smoking gun.
>
> Which kernel, and which version, is the above quote from?

Linux kernel source, 2.4.3, I think i386 version (though it should be the
same for this bit, it's supposed to be MI). Check out
http://lxr.linux.no/source/

I do recall the reason for the thread. :-) I see three choices:

1) Change back to SIG_DFL for normal behavior. I think this will be fineas we run w/o problem on systems that lack this
behavior.Ifturning off automatic child reaping would cause a problem, we'dhave seen it already on the OSs which don't
automaticallyreapchildren. Will a backend ever fork after it's started?
 

2) Change to DFL around system() and then change back.

3) Realize that ECHILD means that the child was auto-reaped (which is anok think and, I think, will only happen if the
childexited w/oerror).
 

Take care,

Bill



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

Предыдущее
От: Vince Vielhaber
Дата:
Сообщение: developer's website
Следующее
От: Tom Lane
Дата:
Сообщение: Autoconf 2.50 is out (was Re: [PATCHES] Re: OpenUnix 8 Patch)