Re: [HACKERS] Function to kill backend

From: Bruce Momjian <pgman(at)candle(dot)pha(dot)pa(dot)us>
To: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
Cc: Josh Berkus <josh(at)agliodbs(dot)com>, Magnus Hagander <mha(at)sollentuna(dot)net>, PostgreSQL-patches <pgsql-patches(at)postgresql(dot)org>
Subject: Re: [HACKERS] Function to kill backend
Date: 2004-07-24 21:44:14
Message-ID: 200407242144.i6OLiEh19904@candle.pha.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers pgsql-patches


OK, I see your point. Can anyone remember why this was needed? I
remember Magnus wanted query cancel, but what was the logic for session
termination?

---------------------------------------------------------------------------

Tom Lane wrote:
> Bruce Momjian <pgman(at)candle(dot)pha(dot)pa(dot)us> writes:
> > I have applied the attached patch:
> > Exit backend from SIGTERM or FATAL by simulating client EOF, rather than
> > calling proc_exit() directly. This should make SIGTERM more reliable.
>
> After further consideration I have concluded that this was a
> spectacularly bad idea and we should revert that patch. There is a very
> large amount of processing that this patch will cause to happen after a
> FATAL error has been declared, and I doubt that any of it is a good
> idea. Some examples:
>
> * AbortCurrentTransaction() --- not too cool if the FATAL error was one
> of the ones in xact.c that are complaining of fatally bollixed
> transaction state.
>
> * pgstat reporting --- aside from the chance of an outright crash, we
> might be transmitting bogus statistics to the collector.
>
> * sending a ReadyForQuery (Z) message --- one thing we quite certainly
> ain't is ReadyForQuery.
>
> * EnableNotifyInterrupt --- this may result in actually trying to run
> a transaction to look through pg_listener :-(
>
> * ProcessConfigFile, if we had a pending SIGHUP --- also not too cool,
> if the FATAL was from guc.c.
>
>
> I am still dubious that zapping random backends with SIGTERM is a sane
> or supportable idea. But this patch does not make things better, it
> simply greatly increases the chance of a FATAL exit turning into a
> backend crash or PANIC.
>
> regards, tom lane
>

--
Bruce Momjian | http://candle.pha.pa.us
pgman(at)candle(dot)pha(dot)pa(dot)us | (610) 359-1001
+ If your life is a hard drive, | 13 Roberts Road
+ Christ can be your backup. | Newtown Square, Pennsylvania 19073

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Tom Lane 2004-07-24 22:51:01 Re: [HACKERS] Function to kill backend
Previous Message Tom Lane 2004-07-24 20:35:55 Re: [HACKERS] Function to kill backend

Browse pgsql-patches by date

  From Date Subject
Next Message Tom Lane 2004-07-24 22:51:01 Re: [HACKERS] Function to kill backend
Previous Message Tom Lane 2004-07-24 20:35:55 Re: [HACKERS] Function to kill backend