Re: Network write errors (was: Re: Feature freeze date for

From: Bruce Momjian <pgman(at)candle(dot)pha(dot)pa(dot)us>
To: andrew(at)supernews(dot)com
Cc: pgsql-hackers(at)postgresql(dot)org
Subject: Re: Network write errors (was: Re: Feature freeze date for
Date: 2005-05-26 01:27:23
Message-ID: 200505260127.j4Q1RNj06476@candle.pha.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers pgsql-patches

Andrew - Supernews wrote:
> On 2005-05-01, Peter Eisentraut <peter_e(at)gmx(dot)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(at)candle(dot)pha(dot)pa(dot)us | (610) 359-1001
+ If your life is a hard drive, | 13 Roberts Road
+ Christ can be your backup. | Newtown Square, Pennsylvania 19073

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Tom Lane 2005-05-26 01:31:45 Re: Source Code Help Needed
Previous Message Jaime Casanova 2005-05-26 00:32:10 Re: adding a function to pg_proc.h

Browse pgsql-patches by date

  From Date Subject
Next Message Tom Lane 2005-05-26 01:52:30 Re: Network write errors (was: Re: Feature freeze date for
Previous Message Bruce Momjian 2005-05-26 00:16:32 pgsql: Add PL/pgSQL SQLSTATE and SQLERRM support which sets these values