Re: SIGCHLD handler in Postgres C function.

Поиск
Список
Период
Сортировка
От Tom Lane
Тема Re: SIGCHLD handler in Postgres C function.
Дата
Msg-id 25436.996534862@sss.pgh.pa.us
обсуждение исходный текст
Список pgsql-hackers
Bill Studenmund <wrstuden@zembu.com> writes:
> I see three choices:

> 1) Change back to SIG_DFL for normal behavior. I think this will be fine
>     as we run w/o problem on systems that lack this behavior. If
>     turning off automatic child reaping would cause a problem, we'd
>     have seen it already on the OSs which don't automatically reap
>     children. Will a backend ever fork after it's started?

Backends never fork more backends --- but there are some places that
launch transient children and wait for them to finish.  A non-transient
subprocess should always be launched by the postmaster, never by a
backend, IMHO.

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

I think this is pretty ugly, and unnecessary.

> 3) Realize that ECHILD means that the child was auto-reaped (which is an
>     ok think and, I think, will only happen if the child exited w/o
>     error).

That's the behavior that's in place now, but I do not like it.  We
should not need to code an assumption that "this error isn't really
an error" --- especially when it only happens on some platforms.
On a non-Linux kernel, an ECHILD failure really would be a failure,
and the existing code would fail to detect that there was a problem.

Bottom line: I like solution #1.  Does anyone have an objection to it?
        regards, tom lane


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

Предыдущее
От: Tom Lane
Дата:
Сообщение: Re: SIGCHLD handler in Postgres C function.
Следующее
От: Vince Vielhaber
Дата:
Сообщение: developer's website