Received: from localhost (unknown [200.46.204.183]) by mail.postgresql.org (Postfix) with ESMTP id 24AF1633C0A for ; Tue, 28 Apr 2009 03:22:41 -0300 (ADT) Received: from mail.postgresql.org ([200.46.204.86]) by localhost (mx1.hub.org [200.46.204.183]) (amavisd-maia, port 10024) with ESMTP id 89900-01 for ; Tue, 28 Apr 2009 03:22:38 -0300 (ADT) X-Greylist: from auto-whitelisted by SQLgrey-1.7.6 Received: from tremor.opencloud.co.nz (tremor.opencloud.co.nz [131.203.101.230]) by mail.postgresql.org (Postfix) with ESMTP id 34172633B67 for ; Tue, 28 Apr 2009 03:21:30 -0300 (ADT) Received: from deluge.opencloud.co.nz ([192.168.0.16]) by tremor.opencloud.co.nz with esmtpsa (TLS-1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.63) (envelope-from ) id 1Lygh5-0002CF-3j for pgsql-jdbc@postgresql.org; Tue, 28 Apr 2009 18:21:27 +1200 Message-ID: <49F6A066.8010105@opencloud.com> Date: Tue, 28 Apr 2009 18:21:26 +1200 From: Oliver Jowett User-Agent: Thunderbird 2.0.0.21 (X11/20090318) MIME-Version: 1.0 To: pgsql-jdbc@postgresql.org Subject: Re: Thread hangs in VisibleBufferedInputStream.readMore References: <20090428061649.GA5531@net-track.ch> In-Reply-To: <20090428061649.GA5531@net-track.ch> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-Virus-Scanned: Maia Mailguard 1.0.1 X-Spam-Status: No, hits=0 tagged_above=0 required=5 tests=none X-Spam-Level: X-Archive-Number: 200904/94 X-Sequence-Number: 19541 Oliver Hitz wrote: > I have recently upgraded from postgresql 7.4.7 to 8.3.7. Since then, I > have experienced in our application a thread that hangs forever. The > problem is quite difficult to trace, since the program hangs very > irregularly. Sometimes it hangs after 10 minutes already, sometimes only > after two days. > > After searching the archives, I thought this was maybe connected to batch > inserts and batch updates. Since the thread in question is doing a lot of > batch updates and inserts, I changed it to do normal updates/inserts. But > without success. It won't be the batch insert deadlock, that manifests as blocking on write, not on read. > The call stack of the hanging thread is as follows: > > "MonitoringThread" prio=1 tid=0x00007f40187ac350 nid=0x41e7 runnable [0x0000000045157000..0x0000000045157e20] > at java.net.SocketInputStream.socketRead0(Native Method) > at java.net.SocketInputStream.read(SocketInputStream.java:129) > at org.postgresql.core.VisibleBufferedInputStream.readMore(VisibleBufferedInputStream.java:135) This is "normal" in that the driver is just waiting for more data from the server. > Any hints on how I could go about debugging this issue? I'd take a look at the server backend processes to see what they're doing when your application hangs. -O