Re: How to diagnose application "hangs" in pg_receive?

From: Hannu Krosing <hannu(at)2ndQuadrant(dot)com>
To: Clemens Eisserer <linuxhippy(at)gmail(dot)com>
Cc: pgsql-jdbc(at)postgresql(dot)org
Subject: Re: How to diagnose application "hangs" in pg_receive?
Date: 2011-05-21 15:45:19
Message-ID: 1305992719.7708.47.camel@hvost
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-jdbc

On Sat, 2011-05-21 at 16:08 +0200, Clemens Eisserer wrote:
> Hi,
>
> A hibernate based application I wrote suffers from "hangs" - the
> thread which should fetch the data is stuck at pg_receive (the
> function reading back data from the socket).
> My first idea were threading errors, however after careful code review
> I couldn't find suspicious code.
> The application doesn't do any explicit locking, an excerpt of the
> locking table is at the end of the email.
>
> Any idea what could be going wrong here?

I'm not an expert in JDBC so all the debugging advice is on server
side :)

> Except a broken connction, what could be the reason for never arriving
> reply from the server?

Maybe too small connection pool somewhere on the way, so the statement
is waiting for connection, not for query answer ?

to see if this is the case, set full logging in postgresql.conf and see
if the query reaches the database at all.

You could also start by setting statement_timeout to some sensible value
so that you can rule out a hang statement / query

maybe

set statement_timeout to '5s';

would be a good value to start.

> Thank you in advance, Clemens

--
-------
Hannu Krosing
PostgreSQL Infinite Scalability and Performance Consultant
PG Admin Book: http://www.2ndQuadrant.com/books/

In response to

Browse pgsql-jdbc by date

  From Date Subject
Next Message Kevin Grittner 2011-05-21 16:24:39 Re: How to diagnose application "hangs" in pg_receive?
Previous Message Clemens Eisserer 2011-05-21 14:08:10 How to diagnose application "hangs" in pg_receive?