Re: Cross-backend signals and administration (Was: Re: pg_terminate_backend for same-role) - Mailing list pgsql-hackers

From Daniel Farina
Subject Re: Cross-backend signals and administration (Was: Re: pg_terminate_backend for same-role)
Date
Msg-id CAAZKuFZP+ss9QFzka2uZb9eoThoc0Rp_JvjjL185PTYFFngNXw@mail.gmail.com
Whole thread Raw
In response to Re: Cross-backend signals and administration (Was: Re: pg_terminate_backend for same-role)  (Tom Lane <tgl@sss.pgh.pa.us>)
Responses Re: Cross-backend signals and administration (Was: Re: pg_terminate_backend for same-role)  (Tom Lane <tgl@sss.pgh.pa.us>)
List pgsql-hackers
On Mon, Mar 26, 2012 at 1:57 PM, Tom Lane <tgl@sss.pgh.pa.us> wrote:
> I'm not.  I still wouldn't trust SIGTERMing an individual backend in a
> production database.  It'll probably work, but what if it doesn't?
> Best-case scenario is you'll need to do a panic shutdown to clear the
> stuck lock or whatever that the backend left behind.  (Once you've
> diagnosed the problem, that is.)  Now, in a case where the alternative
> is a database shutdown anyway, you might as well try it.  But it's the
> kind of tool you only want to hand to responsible adults, which is why
> it's superuser-only at the moment.  I'm not sure we should be
> encouraging people to fire that weapon indiscriminately.

Okay, it was my precise intention to hand this to users so that not
only could they cancel their queries, but also force the transaction
to be aborted and the connection to be closed in case there is a
client run amok.  Is there a good injection site -- perhaps
immediately after query cancellation -- where we can put in a
rollback-and-disconnect behavior?

Given this information, my understanding is that even the superuser is
coerced into undertaking an action that is unnecessarily dangerous if
they think the backend would respond to cancellation, but they also
wish to close the connection.

--
fdr


pgsql-hackers by date:

Previous
From: Thom Brown
Date:
Subject: 9.2 commitfest closure (was "Command Triggers, v16")
Next
From: Tom Lane
Date:
Subject: Re: 9.2 commitfest closure (was Command Triggers, v16)