Re: kill -KILL: What happens?

Поиск
Список
Период
Сортировка
От Tom Lane
Тема Re: kill -KILL: What happens?
Дата
Msg-id 21877.1294946166@sss.pgh.pa.us
обсуждение исходный текст
Ответ на Re: kill -KILL: What happens?  (Florian Pflug <fgp@phlo.org>)
Ответы Re: kill -KILL: What happens?  (Robert Haas <robertmhaas@gmail.com>)
Список pgsql-hackers
Florian Pflug <fgp@phlo.org> writes:
> Couldn't normal backends call PostmasterIsAlive and exit if not, just
> like the startup process, the stats collector, autovacuum, bgwriter,
> walwriter, walreceiver, walsender and the wal archiver already do?

> I assumed they do, but now that I grepped the code it seems they don't.

That's intentional: they keep going until the user closes the session or
someone sends them a signal to do otherwise.  The other various
background processes have to watch PostmasterIsAlive because there is no
session to close.

Frankly I'd prefer to get rid of PostmasterIsAlive, not extend its use.
It sucks because you don't get a signal on parent death.  With the
arrival of the latch code, having to check for PostmasterIsAlive
frequently is the only reason for an idle background process to consume
CPU at all.

Another problem with the scheme is that it only works as long as the
background process is providing a *non critical* service.  Eventually we
are probably going to need some way for bgwriter/walwriter to stay alive
long enough to service orphaned backends, rather than disappearing
instantly if the postmaster goes away.
        regards, tom lane


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

Предыдущее
От: David Fetter
Дата:
Сообщение: Re: kill -KILL: What happens?
Следующее
От: Tom Lane
Дата:
Сообщение: Re: kill -KILL: What happens?