mirror of
https://github.com/postgres/postgres.git
synced 2025-07-02 09:02:37 +03:00
Make "unexpected EOF" messages DEBUG1 unless in an open transaction
"Unexpected EOF on client connection" without an open transaction is mostly noise, so turn it into DEBUG1. With an open transaction it's still indicating a problem, so keep those as ERROR, and change the message to indicate that it happened in a transaction.
This commit is contained in:
@ -547,7 +547,7 @@ CopyGetData(CopyState cstate, void *databuf, int minread, int maxread)
|
||||
/* Only a \. terminator is legal EOF in old protocol */
|
||||
ereport(ERROR,
|
||||
(errcode(ERRCODE_CONNECTION_FAILURE),
|
||||
errmsg("unexpected EOF on client connection")));
|
||||
errmsg("unexpected EOF on client connection with an open transaction")));
|
||||
}
|
||||
bytesread = minread;
|
||||
break;
|
||||
@ -566,11 +566,11 @@ CopyGetData(CopyState cstate, void *databuf, int minread, int maxread)
|
||||
if (mtype == EOF)
|
||||
ereport(ERROR,
|
||||
(errcode(ERRCODE_CONNECTION_FAILURE),
|
||||
errmsg("unexpected EOF on client connection")));
|
||||
errmsg("unexpected EOF on client connection with an open transaction")));
|
||||
if (pq_getmessage(cstate->fe_msgbuf, 0))
|
||||
ereport(ERROR,
|
||||
(errcode(ERRCODE_CONNECTION_FAILURE),
|
||||
errmsg("unexpected EOF on client connection")));
|
||||
errmsg("unexpected EOF on client connection with an open transaction")));
|
||||
switch (mtype)
|
||||
{
|
||||
case 'd': /* CopyData */
|
||||
|
Reference in New Issue
Block a user