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

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

Bruce Momjian <pgman(at)candle(dot)pha(dot)pa(dot)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

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message Bruce Momjian 2005-05-26 02:39:50 Re: Implement support for TCP_KEEPCNT, TCP_KEEPIDLE, TCP_KEEPINTVL
Previous Message Tom Lane 2005-05-26 01:44:47 Re: WAL replay failure after file truncation(?)

Browse pgsql-patches by date

  From Date Subject
Next Message Bruce Momjian 2005-05-26 02:39:50 Re: Implement support for TCP_KEEPCNT, TCP_KEEPIDLE, TCP_KEEPINTVL
Previous Message Bruce Momjian 2005-05-26 01:27:23 Re: Network write errors (was: Re: Feature freeze date for