Received: from maia.hub.org (maia-2.hub.org [200.46.204.251]) by mail.postgresql.org (Postfix) with ESMTP id 8F77063313A for ; Thu, 29 Jul 2010 17:14:07 -0300 (ADT) Received: from mail.postgresql.org ([200.46.204.86]) by maia.hub.org (mx1.hub.org [200.46.204.251]) (amavisd-maia, port 10024) with ESMTP id 48453-07 for ; Thu, 29 Jul 2010 20:13:59 +0000 (UTC) X-Greylist: from auto-whitelisted by SQLgrey-1.7.6 Received: from mail63.csoft.net (mail63.csoft.net [205.205.214.4]) by mail.postgresql.org (Postfix) with ESMTP id 7BB2B632E0E for ; Thu, 29 Jul 2010 17:14:00 -0300 (ADT) Received: from mail63.csoft.net (localhost [127.0.0.1]) by mail63.csoft.net (Postfix) with ESMTP id 3665F28432; Thu, 29 Jul 2010 16:13:59 -0400 (EDT) DKIM-Signature: v=1; a=rsa-sha1; c=relaxed; d=csoft.net; h=date:from:to :cc:subject:in-reply-to:message-id:references:mime-version :content-type; s=sel1; bh=4sOaLkM9pfLWx9bYuzWsOzNZSmU=; b=FNonp6 8D2zzHUhqGAgit+NSxRLIuoNrr0587R2Wj6H9jO3IYF81ofUP37XCsWFZ5MiZ0Vp jgBqF1XRubsLqFB3VKNUTRyJ0voHjCMpHoum8uGopeii+v0WqiIvPliTnlEfxLnN nUU4+uoLLs16V5LC97UnkUg3mcDF9QxP4kqLs= Received: from leary.csoft.net (leary.csoft.net [205.205.214.5]) by mail63.csoft.net (Postfix) with ESMTP id 2665228430; Thu, 29 Jul 2010 16:13:59 -0400 (EDT) Received: by leary.csoft.net (Postfix, from userid 1112) id D0AACA206; Thu, 29 Jul 2010 16:13:58 -0400 (EDT) Date: Thu, 29 Jul 2010 16:13:58 -0400 (EDT) From: Kris Jurka X-X-Sender: books@leary.csoft.net To: David Kerr cc: pgsql-jdbc@postgresql.org Subject: Re: Idle in TX / Java process hang's in the vicinity of JDBC In-Reply-To: <20100729182538.GB49189@mr-paradox.net> Message-ID: References: <20100729182538.GB49189@mr-paradox.net> User-Agent: Alpine 2.00 (BSO 1167 2008-08-23) MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII; format=flowed X-Virus-Scanned: Maia Mailguard 1.0.1 X-Spam-Status: No, hits=-1.91 tagged_above=-10 required=5 tests=BAYES_00=-1.9, T_RP_MATCHES_RCVD=-0.01 X-Spam-Level: X-Archive-Number: 201007/128 X-Sequence-Number: 20793 On Thu, 29 Jul 2010, David Kerr wrote: > We've got an issue where an ETL process just sort of stalled on us last > night. > > It left a dreaded "Idle in Transaction" in the database. Although > fortunatly it didn't appear to have any tables locked. > > Stack trace: > java.net.SocketInputStream.socketRead0(Native Method) > java.net.SocketInputStream.read(SocketInputStream.java:129) > org.postgresql.core.VisibleBufferedInputStream.readMore(VisibleBufferedInputStream.java:135) > org.postgresql.core.VisibleBufferedInputStream.ensureBytes(VisibleBufferedInputStream.java:104) > org.postgresql.core.VisibleBufferedInputStream.read(VisibleBufferedInputStream.java:186) > org.postgresql.core.PGStream.Receive(PGStream.java:445) > org.postgresql.core.PGStream.ReceiveTupleV3(PGStream.java:350) > org.postgresql.core.v3.QueryExecutorImpl.processResults(QueryExecutorImpl.java:1306) > org.postgresql.core.v3.QueryExecutorImpl.execute(QueryExecutorImpl.java:192) > - locked org.postgresql.core.v3.QueryExecutorImpl@18493c9 > org.postgresql.jdbc2.AbstractJdbc2Statement.execute(AbstractJdbc2Statement.java:451) > org.postgresql.jdbc2.AbstractJdbc2Statement.executeWithFlags(AbstractJdbc2Statement.java:336) > org.postgresql.jdbc2.AbstractJdbc2Statement.executeQuery(AbstractJdbc2Statement.java:235) The stacktrace indicates that Statement.executeQuery was called and the JDBC driver started receiving the results from the server. The driver is in the middle of reading a particular row and is waiting for more data from the server. From what you're saying the server thinks it is done, but the driver does not, indicating loss of protocol synchronization. That's tough to debug after the fact, without a reproducible case or network traffic dump. If you still have this connection stuck in this state you could try poking around with a debugger to say what values the ReceiveTupleV3 routine has for l_size and already stored in answer. > We were wondering what the: > org.postgresql.core.v3.QueryExecutorImpl.execute(QueryExecutorImpl.java:192) > - locked org.postgresql.core.v3.QueryExecutorImpl@18493c9 > > was refering to. > This is just indicating that this routine is synchronized. This is done to prevent multiple threads from trying to communicate with the server simultaneously and does not indicate a problem. Kris Jurka