Re: idle_in_transaction_timeout - Mailing list pgsql-hackers

From Alvaro Herrera
Subject Re: idle_in_transaction_timeout
Date
Msg-id 20140603215515.GI5146@eldon.alvh.no-ip.org
Whole thread Raw
In response to Re: idle_in_transaction_timeout  (Josh Berkus <josh@agliodbs.com>)
List pgsql-hackers
Josh Berkus wrote:

> Argument in favor of breaking the connection: most of the time, IITs are
> caused by poor error-handling or garbage-collection code on the client
> side, which has already abandoned the application session but hadn't let
> go of the database handle.  Since the application is never going to
> reuse the handle, terminating it is the right thing to do.

In some frameworks where garbage-collection is not involved with things
like this, what happens is that the connection object is reused later.
If you just drop the connection, the right error message will never
reach the application, but if you abort the xact, the next BEGIN issued
by the framework will receive the "connection aborted due to
idle-in-transaction session" message, which I assume is what this patch
would have sent.

Therefore I think if we want this at all it should abort the xact, not
drop the connection.

-- 
Álvaro Herrera                http://www.2ndQuadrant.com/
PostgreSQL Development, 24x7 Support, Training & Services



pgsql-hackers by date:

Previous
From: Tom Lane
Date:
Subject: Re: idle_in_transaction_timeout
Next
From: Andrew Dunstan
Date:
Subject: Re: json casts