Re: BUG #5837: PQstatus() fails to report lost connection

From: Bruce Momjian <bruce(at)momjian(dot)us>
To: Robert Haas <robertmhaas(at)gmail(dot)com>
Cc: Kevin Grittner <Kevin(dot)Grittner(at)wicourts(dot)gov>, "Murray S(dot) Kucherawy" <msk(at)cloudmark(dot)com>, "pgsql-bugs(at)postgresql(dot)org" <pgsql-bugs(at)postgresql(dot)org>, Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
Subject: Re: BUG #5837: PQstatus() fails to report lost connection
Date: 2011-03-11 10:56:01
Message-ID: 201103111056.p2BAu1L22204@momjian.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-bugs

Robert Haas wrote:
> On Tue, Jan 25, 2011 at 10:54 AM, Kevin Grittner
> <Kevin(dot)Grittner(at)wicourts(dot)gov> wrote:
> > Robert Haas <robertmhaas(at)gmail(dot)com> wrote:
> >> I think this patch would only be adding to the confusion. ?When
> >> PQgetResult() is called, we read enough data from the connection
> >> to create and return one result object. ?It's true that this
> >> doesn't necessarily detect an EOF, but IIUC calling PQgetResult()
> >> again is just ONE way that you could trigger another read against
> >> the socket, not the only one. ?I think it would also work to call
> >> PQconsumeInput(), for example.
> >
> > I find it hard to reconcile the above with this:
> >
> > http://archives.postgresql.org/message-id/6493.1295882981@sss.pgh.pa.us
> >
> > and the quote from our documentation referenced here:
> >
> > http://archives.postgresql.org/message-id/4D3D67600200002500039B2C@gw.wicourts.gov
>
> IIUC, Tom's point was that doing it that way would detect the error,
> not that it was the ONLY way to detect the error.
>
> But it's easily testable.
>
> >> I think the real, underlying problem here is that Murray would
> >> like a behavior change
> >
> > More than that I think he wants to be able to read the manual and
> > know what will work, without spending loads of time getting in tune
> > with The Tao of Libpq. ?Based on his initial reading of the docs he
> > expected different behavior; that can be fixed by changing the
> > behavior or changing the docs.
>
> That is why I suggested the type of doc correction that I thought
> would be most helpful and accurate.

Doc patch attached and applied. I used "should be called" instead of
"must".

--
Bruce Momjian <bruce(at)momjian(dot)us> http://momjian.us
EnterpriseDB http://enterprisedb.com

+ It's impossible for everything to be true. +

Attachment Content-Type Size
/rtmp/libpq.diff text/x-diff 791 bytes

In response to

Responses

Browse pgsql-bugs by date

  From Date Subject
Next Message Bruce Momjian 2011-03-11 11:02:26 Re: [BUGS] BUG #5842: Memory leak in PL/Python when taking slices of results
Previous Message John R Pierce 2011-03-11 08:28:07 Re: BUG #5924: bug or feature?