lucene-java-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Matt Magoffin" <apache....@msqr.us>
Subject Intermittent exception on optimize(): IOException: Cannot delete _5.cfs
Date Sat, 07 May 2005 01:43:51 GMT
I'm getting a strange exception with Lucene 1.4.3 that occurs when I run a
unit test from Ant, but not when I run the same unit test inside Eclipse.
The exception is

Caused by: java.io.IOException: Cannot delete _5.cfs
 at org.apache.lucene.store.FSDirectory.renameFile(FSDirectory.java:232)
 at org.apache.lucene.index.IndexWriter$5.doBody(IndexWriter.java:651)
 at org.apache.lucene.store.Lock$With.run(Lock.java:109)
 at org.apache.lucene.index.IndexWriter.mergeSegments(IndexWriter.java:648)
 at
org.apache.lucene.index.IndexWriter.flushRamSegments(IndexWriter.java:575)
 at org.apache.lucene.index.IndexWriter.optimize(IndexWriter.java:468)
 ...

This occurs within a block of code that has exclusive access to the index
at the time of the exception, and right after re-creating the index (via
opening a new IndexWriter with the create parameter set to 'true').

I can't get the error to happen every time, but if I run the unit test
enough times the exception will happen eventually. If I re-run the unit
test after the error occurs, then a different exception gets thrown when
trying to open an IndexReader on this index:

java.lang.ArrayIndexOutOfBoundsException: -1
 at java.util.ArrayList.get(ArrayList.java:324)
 at org.apache.lucene.index.FieldInfos.fieldInfo(FieldInfos.java:155)
 at org.apache.lucene.index.FieldInfos.fieldName(FieldInfos.java:151)
 at
org.apache.lucene.index.SegmentTermEnum.readTerm(SegmentTermEnum.java:149)
 at org.apache.lucene.index.SegmentTermEnum.next(SegmentTermEnum.java:115)
 at
org.apache.lucene.index.TermInfosReader.readIndex(TermInfosReader.java:86)
 at org.apache.lucene.index.TermInfosReader.<init>(TermInfosReader.java:45)
 at org.apache.lucene.index.SegmentReader.initialize(SegmentReader.java:112)
 at org.apache.lucene.index.SegmentReader.<init>(SegmentReader.java:94)
 at org.apache.lucene.index.IndexReader$1.doBody(IndexReader.java:122)
 at org.apache.lucene.store.Lock$With.run(Lock.java:109)
 at org.apache.lucene.index.IndexReader.open(IndexReader.java:111)
 at org.apache.lucene.index.IndexReader.open(IndexReader.java:106)
 ...

which I'm assuming occurs because the index has become corrupted somehow,
possibly during the .optimize() call?

Any ideas are greatly appreciated.


---------------------------------------------------------------------
To unsubscribe, e-mail: java-user-unsubscribe@lucene.apache.org
For additional commands, e-mail: java-user-help@lucene.apache.org


Mime
View raw message