Login | Register For Free | Help
Search for: (Advanced)

Mailing List Archive: Lucene: Java-Dev

A report for "Not so important (but still is a) bug"

 

 

Lucene java-dev RSS feed   Index | Next | Previous | View Threaded


serera at gmail

Nov 8, 2009, 5:58 AM

Post #1 of 5 (314 views)
Permalink
A report for "Not so important (but still is a) bug"

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" java.io.FileNotFoundException: _0.prx
at
org.apache.lucene.store.RAMDirectory.fileLength(RAMDirectory.java:149)
at
org.apache.lucene.index.DocumentsWriter.segmentSize(DocumentsWriter.java:1150)
at
org.apache.lucene.index.DocumentsWriter.flush(DocumentsWriter.java:587)
at
org.apache.lucene.index.IndexWriter.doFlushInternal(IndexWriter.java:3572)
at org.apache.lucene.index.IndexWriter.doFlush(IndexWriter.java:3483)
at org.apache.lucene.index.IndexWriter.flush(IndexWriter.java:3474)
at
org.apache.lucene.index.IndexWriter.addDocument(IndexWriter.java:1940)
at
org.apache.lucene.index.IndexWriter.addDocument(IndexWriter.java:1894)

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.


lucene at mikemccandless

Nov 8, 2009, 7:14 AM

Post #2 of 5 (290 views)
Permalink
Re: A report for "Not so important (but still is a) bug" [In reply to]

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) :)

Mike

On Sun, Nov 8, 2009 at 8:58 AM, Shai Erera <serera [at] gmail> 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" java.io.FileNotFoundException: _0.prx
>     at
> org.apache.lucene.store.RAMDirectory.fileLength(RAMDirectory.java:149)
>     at
> org.apache.lucene.index.DocumentsWriter.segmentSize(DocumentsWriter.java:1150)
>     at
> org.apache.lucene.index.DocumentsWriter.flush(DocumentsWriter.java:587)
>     at
> org.apache.lucene.index.IndexWriter.doFlushInternal(IndexWriter.java:3572)
>     at org.apache.lucene.index.IndexWriter.doFlush(IndexWriter.java:3483)
>     at org.apache.lucene.index.IndexWriter.flush(IndexWriter.java:3474)
>     at
> org.apache.lucene.index.IndexWriter.addDocument(IndexWriter.java:1940)
>     at
> org.apache.lucene.index.IndexWriter.addDocument(IndexWriter.java:1894)
>
> 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: java-dev-unsubscribe [at] lucene
For additional commands, e-mail: java-dev-help [at] lucene


simon.willnauer at googlemail

Nov 8, 2009, 8:18 AM

Post #3 of 5 (290 views)
Permalink
Re: A report for "Not so important (but still is a) bug" [In reply to]

dude, will we have 2.9.2? :)

simon

On Sun, Nov 8, 2009 at 4:14 PM, Michael McCandless
<lucene [at] mikemccandless> wrote:
> 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) :)
>
> Mike
>
> On Sun, Nov 8, 2009 at 8:58 AM, Shai Erera <serera [at] gmail> 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" java.io.FileNotFoundException: _0.prx
>>     at
>> org.apache.lucene.store.RAMDirectory.fileLength(RAMDirectory.java:149)
>>     at
>> org.apache.lucene.index.DocumentsWriter.segmentSize(DocumentsWriter.java:1150)
>>     at
>> org.apache.lucene.index.DocumentsWriter.flush(DocumentsWriter.java:587)
>>     at
>> org.apache.lucene.index.IndexWriter.doFlushInternal(IndexWriter.java:3572)
>>     at org.apache.lucene.index.IndexWriter.doFlush(IndexWriter.java:3483)
>>     at org.apache.lucene.index.IndexWriter.flush(IndexWriter.java:3474)
>>     at
>> org.apache.lucene.index.IndexWriter.addDocument(IndexWriter.java:1940)
>>     at
>> org.apache.lucene.index.IndexWriter.addDocument(IndexWriter.java:1894)
>>
>> 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: java-dev-unsubscribe [at] lucene
> For additional commands, e-mail: java-dev-help [at] lucene
>
>

---------------------------------------------------------------------
To unsubscribe, e-mail: java-dev-unsubscribe [at] lucene
For additional commands, e-mail: java-dev-help [at] lucene


lucene at mikemccandless

Nov 8, 2009, 9:46 AM

Post #4 of 5 (288 views)
Permalink
Re: A report for "Not so important (but still is a) bug" [In reply to]

I sure hope not :) I hope 3.0 is out soonish...

But just in case, I've reopened & marked fix version 2.9.2, so if we
ever do a 2.9.2 that'll remind me to backport.

Mike

On Sun, Nov 8, 2009 at 11:18 AM, Simon Willnauer
<simon.willnauer [at] googlemail> wrote:
> dude, will we have 2.9.2? :)
>
> simon
>
> On Sun, Nov 8, 2009 at 4:14 PM, Michael McCandless
> <lucene [at] mikemccandless> wrote:
>> 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) :)
>>
>> Mike
>>
>> On Sun, Nov 8, 2009 at 8:58 AM, Shai Erera <serera [at] gmail> 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" java.io.FileNotFoundException: _0.prx
>>>     at
>>> org.apache.lucene.store.RAMDirectory.fileLength(RAMDirectory.java:149)
>>>     at
>>> org.apache.lucene.index.DocumentsWriter.segmentSize(DocumentsWriter.java:1150)
>>>     at
>>> org.apache.lucene.index.DocumentsWriter.flush(DocumentsWriter.java:587)
>>>     at
>>> org.apache.lucene.index.IndexWriter.doFlushInternal(IndexWriter.java:3572)
>>>     at org.apache.lucene.index.IndexWriter.doFlush(IndexWriter.java:3483)
>>>     at org.apache.lucene.index.IndexWriter.flush(IndexWriter.java:3474)
>>>     at
>>> org.apache.lucene.index.IndexWriter.addDocument(IndexWriter.java:1940)
>>>     at
>>> org.apache.lucene.index.IndexWriter.addDocument(IndexWriter.java:1894)
>>>
>>> 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: java-dev-unsubscribe [at] lucene
>> For additional commands, e-mail: java-dev-help [at] lucene
>>
>>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: java-dev-unsubscribe [at] lucene
> For additional commands, e-mail: java-dev-help [at] lucene
>
>

---------------------------------------------------------------------
To unsubscribe, e-mail: java-dev-unsubscribe [at] lucene
For additional commands, e-mail: java-dev-help [at] lucene


serera at gmail

Nov 8, 2009, 10:58 AM

Post #5 of 5 (289 views)
Permalink
Re: A report for "Not so important (but still is a) bug" [In reply to]

Oh ... I missed 2.9.1? sigh

Thanks Mike

Shai

On Sun, Nov 8, 2009 at 7:46 PM, Michael McCandless <
lucene [at] mikemccandless> wrote:

> I sure hope not :) I hope 3.0 is out soonish...
>
> But just in case, I've reopened & marked fix version 2.9.2, so if we
> ever do a 2.9.2 that'll remind me to backport.
>
> Mike
>
> On Sun, Nov 8, 2009 at 11:18 AM, Simon Willnauer
> <simon.willnauer [at] googlemail> wrote:
> > dude, will we have 2.9.2? :)
> >
> > simon
> >
> > On Sun, Nov 8, 2009 at 4:14 PM, Michael McCandless
> > <lucene [at] mikemccandless> wrote:
> >> 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) :)
> >>
> >> Mike
> >>
> >> On Sun, Nov 8, 2009 at 8:58 AM, Shai Erera <serera [at] gmail> 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" java.io.FileNotFoundException: _0.prx
> >>> at
> >>> org.apache.lucene.store.RAMDirectory.fileLength(RAMDirectory.java:149)
> >>> at
> >>>
> org.apache.lucene.index.DocumentsWriter.segmentSize(DocumentsWriter.java:1150)
> >>> at
> >>> org.apache.lucene.index.DocumentsWriter.flush(DocumentsWriter.java:587)
> >>> at
> >>>
> org.apache.lucene.index.IndexWriter.doFlushInternal(IndexWriter.java:3572)
> >>> at
> org.apache.lucene.index.IndexWriter.doFlush(IndexWriter.java:3483)
> >>> at org.apache.lucene.index.IndexWriter.flush(IndexWriter.java:3474)
> >>> at
> >>> org.apache.lucene.index.IndexWriter.addDocument(IndexWriter.java:1940)
> >>> at
> >>> org.apache.lucene.index.IndexWriter.addDocument(IndexWriter.java:1894)
> >>>
> >>> 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: java-dev-unsubscribe [at] lucene
> >> For additional commands, e-mail: java-dev-help [at] lucene
> >>
> >>
> >
> > ---------------------------------------------------------------------
> > To unsubscribe, e-mail: java-dev-unsubscribe [at] lucene
> > For additional commands, e-mail: java-dev-help [at] lucene
> >
> >
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: java-dev-unsubscribe [at] lucene
> For additional commands, e-mail: java-dev-help [at] lucene
>
>

Lucene java-dev RSS feed   Index | Next | Previous | View Threaded
 
 


Interested in having your list archived? Contact Gossamer Threads
 
  Web Applications & Managed Hosting Powered by Gossamer Threads Inc.