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

Greetings,

* molind@gmail.com (molind@gmail.com) wrote:
> While it works it opens 1 db connection per thread (8 threads) and queries
> all tiles from list 25k tiles in average. 5 queries per tile. During map
> generation usually 2 threads stuck in idle state.
> 
> http://i.stack.imgur.com/VUU4O.png

This only shows what's happening server-side.

> Look at the last row. Query started. We have a timestamp, then it finished
> and changed state to idle, and we have timestamp of that moment. Everything
> looks ok, except console app which waits answer from server inside
> 
> PGresult *res = PQexec(conn, query);
> 
> It waits for query results from server. And I can't find why server thinks
> that job is done and app says that there was no answer from db yet.

Can you provide a small example test case which illustrates this?  You
didn't provide your code, so it's really difficult to have any idea
what's going on.

What version of libpq is being used and on what platform?  Are you using
SSL at all for your connection?

> 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
> 
> 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.  Is the TCP
connection still fully ESTABLISHED on both sides?  What's in the
middle..?  Could you have a firewall or IDS which is dropping the
connections?

	Thanks,

		Stephen

Attachments:

  signature.asc (application/pgp-signature, 835B) download

view thread (5+ messages)  latest in thread

Message-ID: <20140425182142.GQ2556@tamriel.snowman.net>
Permalink:  ../20140425182142.GQ2556@tamriel.snowman.net/
Also on:    postgresql.org/message-id/20140425182142.GQ2556@tamriel.snowman.net

 · 

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

* 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