Re: "unexpected EOF" messages

From: Magnus Hagander <magnus(at)hagander(dot)net>
To: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
Cc: Robert Haas <robertmhaas(at)gmail(dot)com>, Alvaro Herrera <alvherre(at)commandprompt(dot)com>, Simon Riggs <simon(at)2ndquadrant(dot)com>, Pg Hackers <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: "unexpected EOF" messages
Date: 2012-05-03 17:04:16
Message-ID: CABUevExMoYN3GtH+Y9QrkYf4_8-EpHkH0Kx9m7zfRxUebphicQ@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On Thu, May 3, 2012 at 5:39 PM, Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us> wrote:
> Robert Haas <robertmhaas(at)gmail(dot)com> writes:
>> On Thu, May 3, 2012 at 11:20 AM, Alvaro Herrera
>> <alvherre(at)commandprompt(dot)com> wrote:
>>> Hey, maybe we could add a UUID to each ereport() call site ;-)
>
>> I can't help but feel we're designing a $10.00 solution to a $0.25
>> problem.  I think I'd actually support adding something like a UUID to
>> every ereport and a filtering mechanism that works on that basis.  But
>> let's face it: this particular message is exponentially more annoying
>> than average.  We're basically forcing application developers to jump
>> through hoops to avoid filling the log with unnecessary chatter.  I've
>> spent a bunch of time trying to get rid of them in various past jobs,
>> and I've never gotten any benefit out of having them.  Maybe the
>> solution is to just demote that particular message to DEBUG1 and
>> declare that closing the connection is a perfectly sensible way for an
>> application to indicate that the conversation is over.
>
> I could support that with one tweak: it's only DEBUG1 if you don't
> have an open transaction.  Dropping the connection while in a
> transaction *is* an application bug; I don't care how lazy the app
> programmer is feeling.

I agree - that would certainly be a good fix for this one. One
question is do we want something like this:

- ereport(COMMERROR,
+ ereport(IsTransactionState() ? COMMERROR : DEBUG1,
(errcode(ERRCODE_PROTOCOL_VIOLATION),
errmsg("unexpected EOF on client connection")));

(in a couple of places, yes)

or do we want to make the text of the error message different as well,
saying something like "unexpected EOF on client connection with an
open transaction"?

--
 Magnus Hagander
 Me: http://www.hagander.net/
 Work: http://www.redpill-linpro.com/

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Tom Lane 2012-05-03 17:09:48 Re: "unexpected EOF" messages
Previous Message Josh Berkus 2012-05-03 17:03:09 Re: Future In-Core Replication