pg.ddx.io  pgsql-odbc@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Tom Lane <tgl@sss.pgh.pa.us>
To: John Rogers <John@delosis.com>
Cc: pgsql-odbc@postgresql.org
Subject: Re: hanging select processes
Date: Mon, 26 Jul 2004 01:45:18 -0400
Message-ID: <19312.1090820718@sss.pgh.pa.us> (raw)
In-Reply-To: <40FBA013.3090905@delosis.com>
References: <40FBA013.3090905@delosis.com>

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



view thread (3+ messages)  latest in thread

Message-ID: <19312.1090820718@sss.pgh.pa.us>
Permalink:  ../19312.1090820718@sss.pgh.pa.us/
Also on:    postgresql.org/message-id/19312.1090820718@sss.pgh.pa.us

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients from your mail client; the link fills in
  the headers below: reply via email
  Some clients, webmail especially, drop In-Reply-To and References from
  a link, and the reply then starts a new thread: use the mbox below.

  To: pgsql-odbc@postgresql.org
  Cc: tgl@sss.pgh.pa.us, John@delosis.com
  Subject: Re: hanging select processes
  In-Reply-To: <19312.1090820718@sss.pgh.pa.us>
  References: <40FBA013.3090905@delosis.com> <19312.1090820718@sss.pgh.pa.us>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox