pg.ddx.io  pgsql-bugs@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Tom Lane <tgl@sss.pgh.pa.us>
To: Stephen Frost <sfrost@snowman.net>
Cc: molind@gmail.com
Cc: pgsql-bugs@postgresql.org
Subject: Re: BUG #10141: Server fails to send query result.
Date: Fri, 25 Apr 2014 15:20:15 -0400
Message-ID: <13193.1398453615@sss.pgh.pa.us> (raw)
In-Reply-To: <20140425182142.GQ2556@tamriel.snowman.net>
References: <20140425155227.2715.56833@wrigleys.postgresql.org>
	<20140425182142.GQ2556@tamriel.snowman.net>
List-Unsubscribe: <mailto:majordomo@postgresql.org?body=unsub%20pgsql-bugs>

Stephen Frost <sfrost@snowman.net> writes:
> * molind@gmail.com (molind@gmail.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


-- 
Sent via pgsql-bugs mailing list (pgsql-bugs@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-bugs



view thread (5+ messages)  latest in thread

Message-ID: <13193.1398453615@sss.pgh.pa.us>
Permalink:  ../13193.1398453615@sss.pgh.pa.us/
Also on:    postgresql.org/message-id/13193.1398453615@sss.pgh.pa.us

 · 

reply

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-bugs@postgresql.org
  Cc: tgl@sss.pgh.pa.us, sfrost@snowman.net, molind@gmail.com
  Subject: Re: BUG #10141: Server fails to send query result.
  In-Reply-To: <13193.1398453615@sss.pgh.pa.us>
  References: <20140425155227.2715.56833@wrigleys.postgresql.org> <20140425182142.GQ2556@tamriel.snowman.net> <13193.1398453615@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