From: Kris Jurka <books@ejurka.com>
To: Royce Ausburn <royce@inomial.com>
Cc: pgsql-jdbc@postgresql.org
Subject: Re: Bug report: TCP deadlock between JDBC & Postgres
Date: Thu, 9 Apr 2015 19:03:47 -0400 (EDT)
Message-ID: <alpine.BSO.2.03.1504091900340.8641@ejurka.com> (raw)
In-Reply-To: <F0785602-CD9D-4DA2-830D-5074CEE3E02E@inomial.com>
References: <F0785602-CD9D-4DA2-830D-5074CEE3E02E@inomial.com>
List-Unsubscribe: <mailto:majordomo@postgresql.org?body=unsub%20pgsql-jdbc>
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.
>
> The issue appears to be in how processDeadParsedQueries() 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.
>
Certainly the driver shouldn't deadlock in this situation and should only
send a limited number of close requests at once, but if your diagnosis is
correct that GC is triggering finalization of these resources, it seems
your application is partly at fault here. If these resources were closed
when complete instead of relying on GC, they would dissipate at a
reasonably rate and not cause this deadlock. Perhaps you need to add some
more close() calls to your code?
Kris Jurka
--
Sent via pgsql-jdbc mailing list (pgsql-jdbc@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-jdbc
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: books@ejurka.com, royce@inomial.com
Subject: Re: Bug report: TCP deadlock between JDBC & Postgres
In-Reply-To: <alpine.BSO.2.03.1504091900340.8641@ejurka.com>
References: <F0785602-CD9D-4DA2-830D-5074CEE3E02E@inomial.com> <alpine.BSO.2.03.1504091900340.8641@ejurka.com>
* 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