From: Tom Lane <tgl@sss.pgh.pa.us>
To: Robert Haas <robertmhaas@gmail.com>
Cc: pgsql-committers <pgsql-committers@postgresql.org>
Subject: Re: pgsql: libpq: Notice errors a backend may have sent just before dying.
Date: Thu, 12 Nov 2015 11:54:40 -0500
Message-ID: <30762.1447347280@sss.pgh.pa.us> (raw)
In-Reply-To: <25514.1447345518@sss.pgh.pa.us>
References: <E1Zwsge-0006XK-Py@gemulon.postgresql.org>
<32700.1447338569@sss.pgh.pa.us>
<CA+TgmoZ=6ZQk5J2tZuSVkBUjrOK-FPQMLpW4uxbdEEz6UY784Q@mail.gmail.com>
<25514.1447345518@sss.pgh.pa.us>
List-Unsubscribe: <mailto:majordomo@postgresql.org?body=unsub%20pgsql-committers>
I wrote:
> After looking around, I suspect what actually happened in your test
> was that we kept pumping pqReadData until it realized it was seeing EOF,
> whereupon it did pqDropConnection(), and guess what that does:
> /* Discard any unread/unsent data */
> conn->inStart = conn->inCursor = conn->inEnd = 0;
> conn->outCount = 0;
So after further review, this is a bug I introduced in 210eb9b74:
the fact that some code paths flushed the buffers and some did not
was less of an oversight than it appeared. That explains why the
problem wasn't noticed years ago, because we'd certainly tested
pqHandleSendFailure and friends before.
I'm inclined to deal with this by adding a "dropInput" boolean flag
to pqDropConnection(), rather than reverting the centralization of
that logic altogether.
I'll go clean this up ...
regards, tom lane
--
Sent via pgsql-committers mailing list (pgsql-committers@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-committers
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Reply to all the recipients from your mail client; the link fills in
the headers below: reply via email
Some clients, webmail especially, drop In-Reply-To and References from
a link, and the reply then starts a new thread: use the mbox below.
To: pgsql-committers@postgresql.org
Cc: tgl@sss.pgh.pa.us, robertmhaas@gmail.com
Subject: Re: pgsql: libpq: Notice errors a backend may have sent just before dying.
In-Reply-To: <30762.1447347280@sss.pgh.pa.us>
References: <E1Zwsge-0006XK-Py@gemulon.postgresql.org> <32700.1447338569@sss.pgh.pa.us> <CA+TgmoZ=6ZQk5J2tZuSVkBUjrOK-FPQMLpW4uxbdEEz6UY784Q@mail.gmail.com> <25514.1447345518@sss.pgh.pa.us> <30762.1447347280@sss.pgh.pa.us>
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox