lucene-java-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Christopher Tignor <>
Subject IndexWriter optimize() deadlock
Date Fri, 16 Oct 2009 16:49:39 GMT

I am trying to track down the cause of my code hanging on calling
IndexWriter.optimize() at its doWait() method.
It appears, thus that it is watiing on other merges to happen which is a bit
confusing to me:

My application is a simple producer consumer model where documents are added
to a queue by producers and then one consumer with one indexwriter (the only
in the application) periodically calls addDocument() on a batch of these
jobs and then calls optimize(), commit(). and then close().  There is only
one thread running the consumer so I am confused as to how the indexwriter
might be deadlocking itself.  Indeed this is the only thread active when the
deadlock occurs so it seems to be a problem of reentry.

Importantly, the deadlocking occurs only when the thread is trying to
shutdown - that is the Thread running this lucene consumer has a Future that
has had its cancel(true) interrupting method called.  Is it possible that an
internal Lucene lock is obtained during addDocument() and on interruption is
never released so the subsequent optimize() call hangs?  This doesn't appear
to be happening...

Any help appreciated.



what might I be missing here?


Christopher Tignor | Senior Software Architect
155 Spring Street NY, NY 10012
p.212-285-8600 x385 f.212-285-8999

  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message