Re: Cancelling idle in transaction state

Robert Haas <robertmhaas@gmail.com>

From: Robert Haas <robertmhaas@gmail.com>
To: Joachim Wieland <joe@mcknight.de>
Cc: Simon Riggs <simon@2ndquadrant.com>, Kris Jurka <books@ejurka.com>, Tom Lane <tgl@sss.pgh.pa.us>, Hannu Krosing <hannu@2ndquadrant.com>, James Pye <lists@jwp.name>, pgsql-hackers <pgsql-hackers@postgresql.org>
Date: 2010-01-06T21:43:29Z
Lists: pgsql-hackers
On Wed, Jan 6, 2010 at 4:37 PM, Joachim Wieland <joe@mcknight.de> wrote:
> On Fri, Jan 1, 2010 at 10:45 PM, Simon Riggs <simon@2ndquadrant.com> wrote:
>> CancelRequest's behaviour currently equates to SIGINT, so
>> processCancelRequest() can only use SIGINT if SIGINT's behaviour remains
>> same.
>>
>> I would recommend we make SIGINT do cancel-anything, and handle
>> everything else via SIGUSR1, including CancelRequest.
>
> Actually, now that I look into it, if we wanted to send SIGUSR1 with a
> reason to a backend from within postmaster (where
> processCancelRequest() lives), we'd need to have shared memory access
> in postmaster which we have not.
>
> So the easiest way would be to keep SIGINTs behavior (cancel running
> statements, not idle transactions) and allow cancellation of idle
> transactions only via SQL but not via command line.

+1.  That seems like the right approach to me.

...Robert