Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtp (Exim 4.80) (envelope-from ) id 1YgLUH-0002Pd-Hw for pgsql-jdbc@arkaria.postgresql.org; Thu, 09 Apr 2015 23:03:53 +0000 Received: from localhost ([127.0.0.1] helo=postgresql.org) by malur.postgresql.org with smtp (Exim 4.80) (envelope-from ) id 1YgLUH-0002Bg-0f for pgsql-jdbc@arkaria.postgresql.org; Thu, 09 Apr 2015 23:03:53 +0000 Received: from makus.postgresql.org ([2001:4800:1501:1::229]) by malur.postgresql.org with esmtps (TLS1.2:DHE_RSA_AES_256_CBC_SHA256:256) (Exim 4.80) (envelope-from ) id 1YgLUF-0002BX-Tk for pgsql-jdbc@postgresql.org; Thu, 09 Apr 2015 23:03:52 +0000 Received: from mail63.csoft.net ([96.47.74.135]) by makus.postgresql.org with esmtp (Exim 4.80) (envelope-from ) id 1YgLUC-0001oj-9i for pgsql-jdbc@postgresql.org; Thu, 09 Apr 2015 23:03:49 +0000 Received: from mail63.csoft.net (localhost [127.0.0.1]) by mail63.csoft.net (Postfix) with ESMTP id 6F17A1285718; Thu, 9 Apr 2015 19:03:47 -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=5msDP7hSbUqZgMp1J7BIwnoA7GE=; b=LL05i/ c08gaOtHEz+uI/DmwzAiyLaIIBtxoHad3rzp/PfaKgdrV2hN89/avys6hRxu5ge4 PYafuIpUQtE8+mVrk7QyAmPZmqV3PsAnDKOSDwsDigQ+HjDdA17EeSAByfqhu9Br h3IfKoVVmWr9elhuSQwimgo8rrZmACRSonRlc= Received: from leary.csoft.net (leary.csoft.net [96.47.74.130]) by mail63.csoft.net (Postfix) with ESMTP id 662571285715; Thu, 9 Apr 2015 19:03:47 -0400 (EDT) Received: by leary.csoft.net (Postfix, from userid 1112) id 45D0B13566; Thu, 9 Apr 2015 19:03:47 -0400 (EDT) Date: Thu, 9 Apr 2015 19:03:47 -0400 (EDT) From: Kris Jurka X-X-Sender: books@leary.csoft.net To: Royce Ausburn cc: pgsql-jdbc@postgresql.org Subject: Re: Bug report: TCP deadlock between JDBC & Postgres In-Reply-To: Message-ID: References: User-Agent: Alpine 2.03 (BSO 1266 2009-07-14) MIME-Version: 1.0 X-Pg-Spam-Score: -2.6 (--) Content-Type: TEXT/PLAIN; charset=ISO-8859-15 Content-Transfer-Encoding: QUOTED-PRINTABLE List-Archive: List-Help: List-ID: List-Owner: List-Post: List-Subscribe: List-Unsubscribe: X-Mailing-List: pgsql-jdbc Precedence: bulk Sender: pgsql-jdbc-owner@postgresql.org On Thu, 9 Apr 2015, Royce Ausburn wrote: > The issue emerged just after we've bumped the max JVM heap size > significantly and during a heavy running migration/data transformation > process with lots of jdbc queries. >=20 > The issue appears to be in how=A0processDeadParsedQueries() works - if > there're a lot of recently GC'd parsed statements then there'll be a lot = of > statements to close which manages to fill the send buffer on our end while > the corresponding postgres process on the server end is busy filling its > send buffer with responses from the close statement requests. =A0 >=20 Certainly the driver shouldn't deadlock in this situation and should only=20 send a limited number of close requests at once, but if your diagnosis is=20 correct that GC is triggering finalization of these resources, it seems=20 your application is partly at fault here. If these resources were closed=20 when complete instead of relying on GC, they would dissipate at a=20 reasonably rate and not cause this deadlock. Perhaps you need to add some= =20 more close() calls to your code? Kris Jurka --=20 Sent via pgsql-jdbc mailing list (pgsql-jdbc@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-jdbc