lucene-java-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Jeremy Volkman <jvolk...@gmail.com>
Subject Deadlock with concurrent merges and IndexWriter [Lucene 2.4]
Date Wed, 25 Mar 2009 21:40:59 GMT
Just ran into this. I'm using Lucene 2.4 in the following manner:

1. Open IndexWriter
2. Add documents
3. Delete documents
4. Close IndexWriter

I haven't touched the out-of-the-box settings WRT merging. A JVM stacktrace
shows the following:

"Lucene Merge Thread #0" daemon prio=10 tid=0x0000000050cb0c00 nid=0x44ce
waiting for monitor entry [0x0000000047a90000..0x0000000047a90b90]
   java.lang.Thread.State: BLOCKED (on object monitor)
        at
org.apache.lucene.index.IndexWriter.commitMerge(IndexWriter.java:3751)
        - waiting to lock <0x00002aab25254cc8> (a
org.apache.lucene.index.IndexWriter)
        at
org.apache.lucene.index.IndexWriter.mergeMiddle(IndexWriter.java:4240)
        at org.apache.lucene.index.IndexWriter.merge(IndexWriter.java:3877)
        at
org.apache.lucene.index.ConcurrentMergeScheduler.doMerge(ConcurrentMergeScheduler.java:205)
        at
org.apache.lucene.index.ConcurrentMergeScheduler$MergeThread.run(ConcurrentMergeScheduler.java:260)

"Indexing thread [ArticleIngestor]" prio=10 tid=0x000000004fd8d800
nid=0x320f waiting on condition [0x0000000042d43000..0x0000000042d43c10]
  java.lang.Thread.State: RUNNABLE
       at org.apache.lucene.index.IndexWriter.doWait(IndexWriter.java:4491)
       - locked <0x00002aab25254cc8> (a org.apache.lucene.index.IndexWriter)
       at
org.apache.lucene.index.IndexWriter.finishMerges(IndexWriter.java:2790)
       - locked <0x00002aab25254cc8> (a org.apache.lucene.index.IndexWriter)
       at
org.apache.lucene.index.IndexWriter.closeInternal(IndexWriter.java:1632)
       at org.apache.lucene.index.IndexWriter.close(IndexWriter.java:1588)
       at org.apache.lucene.index.IndexWriter.close(IndexWriter.java:1562)

finishMerges is a synchronized method, and commitMerge is also a
synchronized method. finishMerges is waiting for the "runningMerges"
collection to empty out before returning and subsequently giving up the
monitor it holds on the IndexWriter object. That collection won't ever
empty, however, because the merge thread is waiting for the IndexWriter
monitor.

Am I missing something here? Could this be user error?

Thanks,
Jeremy

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