Re: Request: pg_cancel_backend variant that handles 'idle in transaction' sessions
От | Amit Kapila |
---|---|
Тема | Re: Request: pg_cancel_backend variant that handles 'idle in transaction' sessions |
Дата | |
Msg-id | CAA4eK1+9=yN6AMmA-tKVp91-0eNr4MH-ebFKA7mEdh3=--Zbcg@mail.gmail.com обсуждение исходный текст |
Ответ на | Re: Request: pg_cancel_backend variant that handles 'idle in transaction' sessions (Merlin Moncure <mmoncure@gmail.com>) |
Список | 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).
>
>
> 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.
В списке pgsql-hackers по дате отправления: