Re: "unexpected EOF" messages - Mailing list pgsql-hackers

From Robert Haas
Subject Re: "unexpected EOF" messages
Date
Msg-id CA+TgmoaZ7D2_U1Z8Vyd+ef9fGOG-YBQRaascBNSM_biyrZ_A5Q@mail.gmail.com
Whole thread Raw
In response to Re: "unexpected EOF" messages  (Magnus Hagander <magnus@hagander.net>)
Responses Re: "unexpected EOF" messages
List pgsql-hackers
On Mon, May 7, 2012 at 12:39 PM, Magnus Hagander <magnus@hagander.net> wrote:
> Makes sense, will change and commit.

Since the following hunk is repeated 3x, maybe it should be stuffed
into a function that is then called in three places:

+               if (IsTransactionState())
+                       ereport(COMMERROR,
+                                       (errcode(ERRCODE_CONNECTION_FAILURE),
+                                        errmsg("unexpected EOF on
client connection with an open transaction")));
+               else
+               {
+                       /*
+                        * Can't send DEBUG log messages to client at
this point.
+                        * Since we're disconnecting right away, we
don't need to
+                        * restore whereToSendOutput.
+                        */
+                       whereToSendOutput = DestNone;
+                       ereport(DEBUG1,
+
(errcode(ERRCODE_CONNECTION_DOES_NOT_EXIST),
+                                        errmsg("unexpected EOF on
client connection")));
+               }

-- 
Robert Haas
EnterpriseDB: http://www.enterprisedb.com
The Enterprise PostgreSQL Company


pgsql-hackers by date:

Previous
From: Tom Lane
Date:
Subject: Re: Latch for the WAL writer - further reducing idle wake-ups.
Next
From: Magnus Hagander
Date:
Subject: Re: "unexpected EOF" messages