Unix Technical Forum

Feature freeze date for 8.1

This is a discussion on Feature freeze date for 8.1 within the pgsql Hackers forums, part of the PostgreSQL category; --> Andrew - Supernews wrote: > On 2005-05-01, Peter Eisentraut <peter_e@gmx.net> wrote: > > The problem, as I understand it, ...


Go Back   Unix Technical Forum > Database Server Software > PostgreSQL > pgsql Hackers

FAQ Members List Calendar Search Today's Posts Mark Forums Read
  #71 (permalink)  
Old 04-11-2008, 05:04 AM
Bruce Momjian
 
Posts: n/a
Default Re: Network write errors (was: Re: Feature freeze date for

Andrew - Supernews wrote:
> On 2005-05-01, Peter Eisentraut <peter_e@gmx.net> wrote:
> > The problem, as I understand it, is that if you have a long-running
> > query and the client process disappears, the query keeps running and
> > holds whatever resources it may have until it finishes. In fact, it
> > keeps sending data to the client and keeps ignoring the SIGPIPE it gets
> > (in case of a Unix-domain socket connection).

>
> Ignoring the SIGPIPE is exactly the right thing to do.
>
> What's _not_ a good idea is ignoring the EPIPE error from write(), which
> seems to currently be reported via ereport(COMMERROR) which doesn't try
> and abort the query as far as I can tell.


Where are you seeing this? I looked from PostgresMain() to
ReadCommand() to SocketBackend() to pq_getbyte() which returns EOF, and
PostgresMain checks that and does a proc_exit(0).

I think the main problem is that a long-running query never tries to
interact with the client during the query.

--
Bruce Momjian | http://candle.pha.pa.us
pgman@candle.pha.pa.us | (610) 359-1001
+ If your life is a hard drive, | 13 Roberts Road
+ Christ can be your backup. | Newtown Square, Pennsylvania 19073

---------------------------(end of broadcast)---------------------------
TIP 4: Don't 'kill -9' the postmaster

Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #72 (permalink)  
Old 04-11-2008, 05:04 AM
Tom Lane
 
Posts: n/a
Default Re: Network write errors (was: Re: Feature freeze date for

Bruce Momjian <pgman@candle.pha.pa.us> writes:
> Andrew - Supernews wrote:
>> What's _not_ a good idea is ignoring the EPIPE error from write(), which
>> seems to currently be reported via ereport(COMMERROR) which doesn't try
>> and abort the query as far as I can tell.


> Where are you seeing this? I looked from PostgresMain() to
> ReadCommand() to SocketBackend() to pq_getbyte() which returns EOF, and
> PostgresMain checks that and does a proc_exit(0).


It sounds like you were following the input-from-client logic. Andrew
is complaining about the output-to-client side.

We deliberately don't abort on write-to-client failure. There have
been periodic discussions about changing that, but I'm not convinced
that the advocates for a change have made a good case. Right now,
it's predictable that the backend only fails due to loss of connection
when it waits for a new command. The behavior would become much less
predictable if we allowed write failure to abort the query. As an
example: whether an UPDATE command completes might depend on whether
any invoked triggers try to issue NOTICEs.

regards, tom lane

---------------------------(end of broadcast)---------------------------
TIP 3: if posting/reading through Usenet, please send an appropriate
subscribe-nomail command to majordomo@postgresql.org so that your
message can get through to the mailing list cleanly

Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Reply


Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On
Forum Jump


All times are GMT. The time now is 05:11 AM.


Powered by vBulletin® Version 3.6.5
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Search Engine Optimization by vBSEO 3.2.0
www.UnixAdminTalk.com