Re: hanging select processes

Поиск
Список
Период
Сортировка
От Tom Lane
Тема Re: hanging select processes
Дата
Msg-id 19312.1090820718@sss.pgh.pa.us
обсуждение исходный текст
Ответ на hanging select processes  (John Rogers <John@delosis.com>)
Список 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 по дате отправления:

Предыдущее
От: John Rogers
Дата:
Сообщение: hanging select processes
Следующее
От: "Dave Page"
Дата:
Сообщение: Re: problem with CVS version