lucene-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Michael McCandless <>
Subject Re: A report for "Not so important (but still is a) bug"
Date Sun, 08 Nov 2009 15:14:06 GMT
We should fix this; I'll open an issue & dig.

Somehow SegmentInfo.files() is being buggy, claiming _0.prx is a file
belonging to the segment, when it clearly isn't.

BTW we can't hold 2.9.1, since it's now "out" (as of yesterday) :)


On Sun, Nov 8, 2009 at 8:58 AM, Shai Erera <> wrote:
> Hi
> I wanted to check something and wrote this very simple program, which
> surprisingly failed because of a FileNotFound exception:
>       Directory dir = new RAMDirectory();
>       IndexWriter writer = new IndexWriter(dir, new SimpleAnalyzer(),
> MaxFieldLength.UNLIMITED);
>       writer.setInfoStream(System.out);
>       writer.addDocument(new Document());
>       writer.commit();
>       writer.close();
> It fails with the exception:
> Exception in thread "main" _0.prx
>     at
>     at
> org.apache.lucene.index.DocumentsWriter.segmentSize(
>     at
> org.apache.lucene.index.DocumentsWriter.flush(
>     at
> org.apache.lucene.index.IndexWriter.doFlushInternal(
>     at org.apache.lucene.index.IndexWriter.doFlush(
>     at org.apache.lucene.index.IndexWriter.flush(
>     at
> org.apache.lucene.index.IndexWriter.addDocument(
>     at
> org.apache.lucene.index.IndexWriter.addDocument(
> This happens on the latest code from trunk (and validated also against 2.4).
> Seems like it's there forever. This only happens when I set infoStream,
> because as part of the logging we compute the segment size. _0.prx is not
> found because I didn't add any terms to the index. If I don't set the
> infoStream, or add terms to the index, this exception is not thrown.
> Like I wrote in the subject, I don't think it's that important (for example
> to hold off 2.9.1), but still a bug. Not a very important bug even, but I
> can't get it out of my head that it's still a bug :)
> Can be fixed by making sure segmentSize() does not thrown any FNF exception
> for missing .prx? Does not sound too safe to me. Maybe we just remember this
> and tell people (like me) "even in silly tests, add a term to the document"?
> Shai.

To unsubscribe, e-mail:
For additional commands, e-mail:

View raw message