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

From Amit Kapila
Subject Re: Request: pg_cancel_backend variant that handles 'idle in transaction' sessions
Date
Msg-id CAA4eK1+9=yN6AMmA-tKVp91-0eNr4MH-ebFKA7mEdh3=--Zbcg@mail.gmail.com
Whole thread Raw
In response to Re: Request: pg_cancel_backend variant that handles 'idle in transaction' sessions  (Merlin Moncure <mmoncure@gmail.com>)
List pgsql-hackers
On Tue, Nov 3, 2015 at 7:53 PM, Merlin Moncure <mmoncure@gmail.com> wrote:
>
> On Mon, Nov 2, 2015 at 8:42 PM, Amit Kapila <amit.kapila16@gmail.com> wrote:
> >
> > What exactly do we want to define session_idle_timeout?  Some
> > possibilities:
> > a. Reset the session related variables like transaction, prepared
> > statements, etc. and retain it for connection pool kind of stuff
> > b. Exit from the session
> >
> > If we want something on lines of option (a), then I think it is better
> > to have just a single time out (session_idle_timeout/idle_timeout)
>
> I'm not thrilled about the prefix 'session_': most .conf variables
> apply to the session (like statement_timeout) and we don't use the
> session prefix for any of those.
>
> "transaction_idle_timeout" is ok, if you want the timeout to apply as
> an expiration for a transaction going idle.
>
> "idle_timeout" doesn't make much sense to me.  It's the responsibility
> of the pooler to mange idle-but-not-in-transaction sessions and we
> already have machinery to support that (DISCARD).
>

I think if transaction is idle for long time, then the chances that someone
will use that session is less, so idle_timeout seems to me the right tool
for such sessions.  I have checked that databases like Oracle also has
such a variable to help out users for such situations.


With Regards,
Amit Kapila.
EnterpriseDB: http://www.enterprisedb.com

pgsql-hackers by date:

Previous
From: Amit Kapila
Date:
Subject: Re: ParallelContexts can get confused about which worker is which
Next
From: Amit Kapila
Date:
Subject: Re: Request: pg_cancel_backend variant that handles 'idle in transaction' sessions