Re: BUG #10141: Server fails to send query result.

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: Stephen Frost <sfrost(at)snowman(dot)net>
Cc: molind(at)gmail(dot)com, pgsql-bugs(at)postgresql(dot)org
Subject: Re: BUG #10141: Server fails to send query result.
Date: 2014-04-25 19:20:15
Message-ID: 13193.1398453615@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-bugs

Stephen Frost <sfrost(at)snowman(dot)net> writes:
> * molind(at)gmail(dot)com (molind(at)gmail(dot)com) wrote:
>> I added PQtrace for each thread and wait for stuck thread. There is trace:

>> From backend> D
>> From backend (#4)> 139891
>> From backend> D
>> From backend (#4)> 139891
>> From backend> D
>> From backend (#4)> 139891
>> From backend> D
>> From backend (#4)> 139891
>> From backend> D
>> From backend (#4)> 139891
>> From backend> D
>> From backend (#4)> 139891

FWIW, this looks suspiciously like libpq is unable to consume data from
its input buffer (and keeps retrying to process the same data). Are you
using PQsetnonblocking by any chance? If so, this probably indicates
failure to follow the required call sequencing to process data.

Another likely theory, given that you mentioned multiple client threads,
is that the threads are stomping on each others' toes somehow. libpq
does not defend itself against that: it's up to you to be sure that
only one thread is touching each PGconn object.

>> Seems problem somewhere inside PostgreSQL. It tries to send result but
>> fails.

> I don't see anything here which shows that to be the case.

Indeed. I'd bet considerable money that this is a client-side issue.
It's possible that it's a libpq bug, but what seems more likely is
that you're using libpq improperly.

regards, tom lane

In response to

Responses

Browse pgsql-bugs by date

  From Date Subject
Next Message sdfasdf asdfasdf 2014-04-25 19:54:10 Re[2]: [BUGS] BUG #10140: Configured for 127.0.0.1 but binds to all IP
Previous Message Tom Lane 2014-04-25 19:09:01 Re: BUG #10140: Configured for 127.0.0.1 but binds to all IP