Re: Statement timeout not working on broken connections with active queries

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: "Brendan O'Shea" <brendanoshea(at)comcast(dot)net>
Cc: pgsql-general(at)postgresql(dot)org
Subject: Re: Statement timeout not working on broken connections with active queries
Date: 2006-12-12 23:30:44
Message-ID: 27531.1165966244@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

"Brendan O'Shea" <brendanoshea(at)comcast(dot)net> writes:
> We have discovered a situation where the statement_timeout is not =
> honored for broken connections. If a connection is in the process of =
> returning results to the client and the connection is severed (for =
> example, network cable on client is unplugged) then the query continues =
> to run on the server even after the statement_timeout is exceeded.

Well, the backend is blocked on a write() to the socket and cannot abort
that without bollixing the connection completely (i.e., loss of message
synchronization). So I think waiting until the TCP stack declares
failure is an appropriate response. If you want faster TCP failure,
see whether your TCP stack allows timeout adjustments.

Note that the query is not "running" in the sense of consuming any
meaningful CPU or I/O resources in this state ...

regards, tom lane

In response to

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Jeff Davis 2006-12-12 23:33:18 Re: Online index builds
Previous Message Tom Lane 2006-12-12 23:25:21 Re: TIMESTAMP WITHOUT TIME ZONE