Re: How to diagnose application "hangs" in pg_receive? - Mailing list pgsql-jdbc

From Hannu Krosing
Subject Re: How to diagnose application "hangs" in pg_receive?
Date
Msg-id 1305992719.7708.47.camel@hvost
Whole thread Raw
In response to How to diagnose application "hangs" in pg_receive?  (Clemens Eisserer <linuxhippy@gmail.com>)
List 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/


pgsql-jdbc by date:

Previous
From: Clemens Eisserer
Date:
Subject: How to diagnose application "hangs" in pg_receive?
Next
From: "Kevin Grittner"
Date:
Subject: Re: How to diagnose application "hangs" in pg_receive?