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 CAA4eK1JdT4P0Y8qwN9YPB9re7zb2-=Ep8_9HEdkSUDr86kdR7A@mail.gmail.com
Whole thread Raw
In response to Re: Request: pg_cancel_backend variant that handles 'idle in transaction' sessions  (Pavel Stehule <pavel.stehule@gmail.com>)
Responses 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:56 PM, Pavel Stehule <pavel.stehule@gmail.com> wrote:


2015-11-03 3:42 GMT+01:00 Amit Kapila <amit.kapila16@gmail.com>:
On Mon, Nov 2, 2015 at 10:45 PM, Pavel Stehule <pavel.stehule@gmail.com> wrote:

It is 100% true. But the users can do strange things. If we solve idle transactions and not idle session, then they are able to increase max_connections to thousands with happy smile in face.

I have not strong idea about how to solve it well - maybe introduce transaction_idle_timeout and session_idle_timeout?


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

b is safe state - and currently it is only one state, that we can forward to client side (with keep_alive packets) - so I prefer b


Okay, I think one more point to consider is that it would be preferable to
have such an option for backend sessions and not for other processes
like WalSender.


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

pgsql-hackers by date:

Previous
From: Amit Kapila
Date:
Subject: Re: Request: pg_cancel_backend variant that handles 'idle in transaction' sessions
Next
From: Craig Ringer
Date:
Subject: Re: RFC/WIP: adding new configuration options to TOAST