pg.ddx.io  pgsql-jdbc@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Hannu Krosing <hannu@2ndQuadrant.com>
To: Clemens Eisserer <linuxhippy@gmail.com>
Cc: pgsql-jdbc@postgresql.org
Subject: Re: How to diagnose application "hangs" in pg_receive?
Date: Sat, 21 May 2011 17:45:19 +0200
Message-ID: <1305992719.7708.47.camel@hvost> (raw)
In-Reply-To: <BANLkTin_F0DVziRuw7jWn+CAB7PYKZLHew@mail.gmail.com>
References: <BANLkTin_F0DVziRuw7jWn+CAB7PYKZLHew@mail.gmail.com>

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/




view thread (8+ messages)  latest in thread

Message-ID: <1305992719.7708.47.camel@hvost>
Permalink:  ../1305992719.7708.47.camel@hvost/
Also on:    postgresql.org/message-id/1305992719.7708.47.camel@hvost

 · 

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-jdbc@postgresql.org
  Cc: hannu@2ndQuadrant.com, linuxhippy@gmail.com
  Subject: Re: How to diagnose application "hangs" in pg_receive?
  In-Reply-To: <1305992719.7708.47.camel@hvost>
  References: <BANLkTin_F0DVziRuw7jWn+CAB7PYKZLHew@mail.gmail.com> <1305992719.7708.47.camel@hvost>

* 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