Received: from localhost (mx1.hub.org [200.46.208.251]) by postgresql.org (Postfix) with ESMTP id B874D9FB273 for ; Wed, 11 Oct 2006 16:09:46 -0300 (ADT) Received: from postgresql.org ([200.46.204.71]) by localhost (mx1.hub.org [200.46.208.251]) (amavisd-new, port 10024) with ESMTP id 80427-07 for ; Wed, 11 Oct 2006 16:09:40 -0300 (ADT) X-Greylist: delayed 00:47:47.764595 by SQLgrey- Received: from boston.agmednet.com (boston.agmednet.com [64.156.16.20]) by postgresql.org (Postfix) with ESMTP id 140B29FB1CD for ; Wed, 11 Oct 2006 16:09:39 -0300 (ADT) Received: from 71.233.123.244 ([71.233.123.244]) by agmednet-dc.boston.agmednet.local ([10.10.39.2]) with Microsoft Exchange Server HTTP-DAV ; Wed, 11 Oct 2006 19:04:16 +0000 User-Agent: Microsoft-Entourage/11.2.5.060620 Date: Wed, 11 Oct 2006 15:09:16 -0400 Subject: Re: "Hanging Connection" blocks access to table (JBossMQ) From: Michael Goldner To: Tom Lane CC: Dave Cramer , Michael Goldner , Message-ID: Thread-Topic: [JDBC] "Hanging Connection" blocks access to table (JBossMQ) Thread-Index: AcbtaL7L/Xvv+llbEduBjQAX8gFv1g== In-Reply-To: <12649.1160593027@sss.pgh.pa.us> Mime-version: 1.0 Content-type: text/plain; charset="US-ASCII" Content-transfer-encoding: 7bit X-Virus-Scanned: Maia Mailguard 1.0.1 X-Spam-Status: No, hits=1.635 tagged_above=0 required=5 tests=FORGED_RCVD_HELO, RCVD_NUMERIC_HELO X-Spam-Level: * X-Archive-Number: 200610/76 X-Sequence-Number: 15959 I should have worded my response more carefully ;) With both Jboss and Postgresql running, a "ps -ef |grep postgres" shows two processes in an "INSERT waiting" state, one in an idle state and the autovacuum process. Jboss is the only application that uses the database, so I'm sure that the processes are not for something else. When I shutdown Jboss, the idle process disappears, but the 2 "INSERT waiting" processes remain indefinitely. Once I restart Postgres, everything immediately clears and it starts again in a normal state with no blocking. I'm going to see if I can put together a test environment to reproduce the problem, but simulating load conditions is always tricky. If I can produce it, I'll be able to gather more information (strace, gdb, etc.). Thanks, Mike On 10/11/06 2:57 PM, "Tom Lane" wrote: > Michael Goldner writes: >> I shut down postgresql manually (pg_ctl restart -m immediiate) after I had >> first stopped Jboss and waited about 30 seconds to see that the two blocking >> connections were not closing. > > Really? "-m immediate" should boot backends off lock waits in any case > ... and does according to my tests. Whether Jboss notices the > connections dropping right away might be another story. What are you > observing as a "not closed" connection? > > I wouldn't personally use "-m immediate" for this purpose mind you. > "-m fast" is safer and should have the same result. > > regards, tom lane -- Mike Goldner Vice President Networks and Technology AG Mednet, Inc. The Pilot House Lewis Wharf Boston, MA 02110 617.854.3225 (office) 617.909.3009 (mobile)