PostgreSQL server does not notice that clients have disappeared

Started by Al Eridaniabout 11 years ago3 messagesgeneral
Jump to latest
#1Al Eridani
al.eridani@gmail.com

More than five years ago Tom Lane wrote

"It's not easy to tell whether a client has disconnected (particularly if
the network stack is unhelpful, which is depressingly often true).
Postgres will cancel a query if it gets told that the connection's been
dropped, but it will only discover this when an attempt to output to the
client fails. It does not spend cycles looking aside to see if the
connection has dropped when it is doing something that doesn't involve
output to the client."

Is this still true on the 9.x versions? Thanks!

#2Maciek Sakrejda
maciek@heroku.com
In reply to: Al Eridani (#1)
Re: PostgreSQL server does not notice that clients have disappeared

On Fri, Jan 23, 2015 at 12:08 PM, Al Eridani <al.eridani@gmail.com> wrote:

Is this still true on the 9.x versions? Thanks!

It is, unfortunately. If your client kicks off a 12h query and immediately
closes the TCP connection, Postgres won't notice until the query has
completed.

#3Al Eridani
al.eridani@gmail.com
In reply to: Maciek Sakrejda (#2)
Re: PostgreSQL server does not notice that clients have disappeared

Thank you for the confirmation!

On Fri, Jan 23, 2015 at 1:24 PM, Maciek Sakrejda <maciek@heroku.com> wrote:

Show quoted text

On Fri, Jan 23, 2015 at 12:08 PM, Al Eridani <al.eridani@gmail.com> wrote:

Is this still true on the 9.x versions? Thanks!

It is, unfortunately. If your client kicks off a 12h query and immediately
closes the TCP connection, Postgres won't notice until the query has
completed.