Re: Request: pg_cancel_backend variant that handles 'idle in transaction' sessions - Mailing list pgsql-hackers

From Stephen Frost
Subject Re: Request: pg_cancel_backend variant that handles 'idle in transaction' sessions
Date
Msg-id 20151104221532.GL3685@tamriel.snowman.net
Whole thread Raw
In response to Re: Request: pg_cancel_backend variant that handles 'idle in transaction' sessions  ("Joshua D. Drake" <jd@commandprompt.com>)
Responses Re: Request: pg_cancel_backend variant that handles 'idle in transaction' sessions  ("Joshua D. Drake" <jd@commandprompt.com>)
Re: Request: pg_cancel_backend variant that handles 'idle in transaction' sessions  (Merlin Moncure <mmoncure@gmail.com>)
List pgsql-hackers
* Joshua D. Drake (jd@commandprompt.com) wrote:
> On 11/04/2015 01:55 PM, Stephen Frost wrote:
> >* Joe Conway (mail@joeconway.com) wrote:
> >>On 11/04/2015 01:24 PM, Alvaro Herrera wrote:
> >>>I agree with Pavel.  Having a transaction timeout just does not make any
> >>>sense.  I can see absolutely no use for it.  An idle-in-transaction
> >>>timeout, on the other hand, is very useful.
> >>
> >>+1 -- agreed
> >
> >I'm not sure of that.  I can certainly see a use for transaction
> >timeouts- after all, they hold locks and can be very disruptive in the
> >long run.  Further, there are cases where a transaction is normally very
> >fast and in a corner case it becomes extremely slow and disruptive to
> >the rest of the system.  In those cases, having a timeout for it is
> >valuable.
>
> Yeah but anything holding a lock that long can be terminated via
> statement_timeout can it not?

Well, no?  statement_timeout is per-statement, while transaction_timeout
is, well, per transaction.  If there's a process which is going and has
an open transaction and it's holding locks, that can be an issue.

To be frank, my gut feeling is that transaction_timeout is actually more
useful than statement_timeout.

Thanks!

Stephen

pgsql-hackers by date:

Previous
From: Joe Conway
Date:
Subject: Re: Request: pg_cancel_backend variant that handles 'idle in transaction' sessions
Next
From: "Joshua D. Drake"
Date:
Subject: Re: Request: pg_cancel_backend variant that handles 'idle in transaction' sessions