Re: hanging select processes - Mailing list pgsql-odbc

From Tom Lane
Subject Re: hanging select processes
Date
Msg-id 19312.1090820718@sss.pgh.pa.us
Whole thread Raw
In response to hanging select processes  (John Rogers <John@delosis.com>)
List pgsql-odbc
John Rogers <John@delosis.com> writes:
> surely postgres should stop the select if the client
> dissapears in a puff of smoke?

The current design intention is that the backend will notice loss of
connection when it next tries to receive a command from the client
--- and not before.  You could argue that a SELECT is side-effect
free and can be aborted arbitrarily, but I wouldn't agree, because
the SELECT could be invoking a user-defined function that does have
side effects.  If we were to abort upon noticing that the output data
didn't seem to be going anywhere, then the behavior would be both
timing-dependent and platform-dependent.

> ... we end up with a postgres SELECT thread running at 99% cpu
> time on our backend.

If the SELECT is taking more CPU than it otherwise would, then that
might represent a bug we oughta fix.  But I don't think that finishing
out a requested SELECT is in and of itself a bug.

            regards, tom lane

pgsql-odbc by date:

Previous
From: John Rogers
Date:
Subject: hanging select processes
Next
From: "Dave Page"
Date:
Subject: Re: problem with CVS version