pg.ddx.io  pgsql-jdbc@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Morten Andersen <moa-ml@instadia.net>
To: Kris Jurka <books@ejurka.com>
Cc: pgsql-jdbc@postgresql.org
Subject: Re: Unexpected NullPointerException in "processDeadParsedQueries()"
Date: Fri, 05 Jan 2007 08:09:09 +0000
Message-ID: <459E07A5.2080705@instadia.net> (raw)
In-Reply-To: <Pine.BSO.4.64.0701041309320.24201@leary2.csoft.net>
References: <4589297C.208@instadia.net>
	<Pine.BSO.4.64.0701041309320.24201@leary2.csoft.net>

Hi Kris,

Kris Jurka wrote:
> 
>> In a multithreaded application I just got an unexpected 
>> NullPointerException from the depth's of the JDBC-drivers cleanup 
>> routine of parsed queries.
>>
> 
> Is this something you can reproduce somewhat regularly or something that 
> just happened once?

Unfortunately it is not reproduceable :-) - I just saw it once, in a 
long running application with heavy load on the driver.

[SNIP]
> 
> Neither of these look particularly likely to me.  All entry points to 
> QueryExecutorImpl that access these items are synchronized so I don't 
> think the thread safety of the individual items are an issue.

After re-inspection, I think you are right. I definitely had a too 
limited "scope" when looking for the cause, since I mostly/only looked 
at registerOpenPortal() and processDeadPortals().

> 
> Is your application multi-threaded and using a Connection per thread or 
> does it use multiple threads per connection?  If using Connection per 
> thread it's even harder to believe this is a thread safety issue because 
> you'll have a QueryExecutorImpl per Connection.

Multi-threaded, with only one thread using one connection at a time, but 
using an Apache Commons Pool, so over time the same connection will be 
used from several threads.

But given the issues with the synchronization on all entry points, as 
you pointed out, I think you are right, in that neither of my two 
suggestions to what the cause of the original stacktrace could be, are 
correct.

So since I don't have any other good ideas to what it could be, and 
since I only saw it once (and nobody else reported a similar issue), we 
should probably just ignore the error as not-reproducable.

But thanks for taking your time to answer, and for looking into this issue.

Best Regards
Morten Andersen,
Instadia A/S, Denmark



view thread (3+ messages)

Message-ID: <459E07A5.2080705@instadia.net>
Permalink:  ../459E07A5.2080705@instadia.net/
Also on:    postgresql.org/message-id/459E07A5.2080705@instadia.net

 · 

reply

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: moa-ml@instadia.net, books@ejurka.com
  Subject: Re: Unexpected NullPointerException in "processDeadParsedQueries()"
  In-Reply-To: <459E07A5.2080705@instadia.net>
  References: <4589297C.208@instadia.net> <Pine.BSO.4.64.0701041309320.24201@leary2.csoft.net> <459E07A5.2080705@instadia.net>

* 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