Re: Request: pg_cancel_backend variant that handles 'idle in transaction' sessions

From: Merlin Moncure <mmoncure(at)gmail(dot)com>
To: Joe Conway <mail(at)joeconway(dot)com>
Cc: Pavel Stehule <pavel(dot)stehule(at)gmail(dot)com>, Alvaro Herrera <alvherre(at)2ndquadrant(dot)com>, Magnus Hagander <magnus(at)hagander(dot)net>, PostgreSQL-development <pgsql-hackers(at)postgresql(dot)org>, Amit Kapila <amit(dot)kapila16(at)gmail(dot)com>, Stephen Frost <sfrost(at)snowman(dot)net>, David Steele <david(at)pgmasters(dot)net>, "Joshua D(dot) Drake" <jd(at)commandprompt(dot)com>, Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
Subject: Re: Request: pg_cancel_backend variant that handles 'idle in transaction' sessions
Date: 2015-11-05 20:01:23
Message-ID: CAHyXU0zfofrmH5AiT03htmXSXWZ0t=9q0ja3OWvf5++S1yZcNA@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On Thu, Nov 5, 2015 at 12:31 PM, Joe Conway <mail(at)joeconway(dot)com> wrote:
> On 11/05/2015 10:09 AM, Pavel Stehule wrote:
>> On 5.11.2015 19:02 Merlin Moncure wrote:
>>> Thus, I think we have consensus that transaction_timeout is good -- it
>>> would deprecate statement_timeout essentially. Likewise,
>>> pg_cancel_transaction is good and would deprecate pg_cancel_backend;
>>> it's hard for me to imagine a scenario where a user would call
>>> pg_cancel_backend if pg_cancel_transaction were to be available.
>>
>> I am sorry, I see a consensus between you and Stephen only.
>
> S
> t C
> a<-------------<transaction>--------------->E
> r A B A B A n
> t <idle> <stmt> <idle> <stmt> <idle> d
> |--------======--------======---------------|
>
> Currently we can set timeout and cancel for period B (<stmt>). I can see
> based on this discussion that there are legitimate use cases for wanting
> timeout and cancel for any of the periods A, B, or C.
>
> I guess the question then becomes how we provide that coverage. I think
> for coverage of timeout you need three individual timeout settings.
> However for cancel, it would seem that pg_cancel_transaction would cover
> all three cases.

Agreed on all points.

Tom noted earlier some caveats with the 'idle' timeout in terms of
implementation. Maybe that needs to be zeroed in on.

merlin

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Oleg Bartunov 2015-11-05 20:05:15 Re: Note about comparation PL/SQL packages and our schema/extensions
Previous Message Robert Haas 2015-11-05 19:07:46 Re: extend pgbench expressions with functions