Re: [HACKERS] Function to kill backend - Mailing list pgsql-patches

From Tom Lane
Subject Re: [HACKERS] Function to kill backend
Date
Msg-id 10020.1090877796@sss.pgh.pa.us
Whole thread Raw
In response to Re: [HACKERS] Function to kill backend  (Oliver Jowett <oliver@opencloud.com>)
Responses Re: [HACKERS] Function to kill backend  (Oliver Jowett <oliver@opencloud.com>)
List pgsql-patches
Oliver Jowett <oliver@opencloud.com> writes:
> What about implementing "kill" as "cancel then exit"? Does that
> guarantee a safe exit in all cases?

That was exactly what Bruce's patch turned it into.  That would be
workable if we separated this case from the existing elog(FATAL)
behavior, but doing it that way is quite unsafe for real FATAL errors,
and I do not think we want SIGTERM response to behave that way either.
(When init SIGTERMs us, we do *not* want to lollygag around, we want
to get the heck out of there so we can write a shutdown checkpoint
before we get SIGKILL'd.)

So what you'd basically need is a separate signal to trigger that sort
of exit, which would be easy ... if we had any spare signal numbers.

            regards, tom lane

pgsql-patches by date:

Previous
From: Oliver Jowett
Date:
Subject: Re: [HACKERS] Function to kill backend
Next
From: Oliver Jowett
Date:
Subject: Re: [HACKERS] Function to kill backend