Issue Details (XML | Word | Printable)

Key: LUCENE-1262
Type: Bug Bug
Status: Closed Closed
Resolution: Fixed
Priority: Major Major
Assignee: Unassigned
Reporter: Trejkaz
Votes: 0
Watchers: 0
Operations

If you were logged in you would be able to see more operations.
Lucene - Java

IndexOutOfBoundsException from FieldsReader after problem reading the index

Created: 09/Apr/08 12:23 AM   Updated: 08/May/08 07:47 PM
Return to search
Component/s: Index
Affects Version/s: 2.3.1
Fix Version/s: 2.3.2, 2.4

Time Tracking:
Not Specified

File Attachments:
  Size
Text File Licensed for inclusion in ASF works LUCENE-1262.patch 2008-04-11 10:20 AM Michael McCandless 6 kB
Java Source File Test.java 2008-04-10 12:31 AM Trejkaz 2 kB

Lucene Fields: New
Resolution Date: 13/Apr/08 11:27 PM


 Description  « Hide
There is a situation where there is an IOException reading from Hits, and then the next time you get a NullPointerException instead of an IOException.

Example stack traces:

java.io.IOException: The specified network name is no longer available
at java.io.RandomAccessFile.readBytes(Native Method)
at java.io.RandomAccessFile.read(RandomAccessFile.java:322)
at org.apache.lucene.store.FSIndexInput.readInternal(FSDirectory.java:536)
at org.apache.lucene.store.BufferedIndexInput.readBytes(BufferedIndexInput.java:74)
at org.apache.lucene.index.CompoundFileReader$CSIndexInput.readInternal(CompoundFileReader.java:220)
at org.apache.lucene.store.BufferedIndexInput.refill(BufferedIndexInput.java:93)
at org.apache.lucene.store.BufferedIndexInput.readByte(BufferedIndexInput.java:34)
at org.apache.lucene.store.IndexInput.readVInt(IndexInput.java:57)
at org.apache.lucene.index.FieldsReader.doc(FieldsReader.java:88)
at org.apache.lucene.index.SegmentReader.document(SegmentReader.java:344)
at org.apache.lucene.index.IndexReader.document(IndexReader.java:368)
at org.apache.lucene.search.IndexSearcher.doc(IndexSearcher.java:84)
at org.apache.lucene.search.Hits.doc(Hits.java:104)

That error is fine. The problem is the next call to doc generates:

java.lang.NullPointerException
at org.apache.lucene.index.FieldsReader.getIndexType(FieldsReader.java:280)
at org.apache.lucene.index.FieldsReader.addField(FieldsReader.java:216)
at org.apache.lucene.index.FieldsReader.doc(FieldsReader.java:101)
at org.apache.lucene.index.SegmentReader.document(SegmentReader.java:344)
at org.apache.lucene.index.IndexReader.document(IndexReader.java:368)
at org.apache.lucene.search.IndexSearcher.doc(IndexSearcher.java:84)
at org.apache.lucene.search.Hits.doc(Hits.java:104)

Presumably FieldsReader is caching partially-initialised data somewhere. I would normally expect the exact same IOException to be thrown for subsequent calls to the method.



 All   Comments   Work Log   Change History   Subversion Commits      Sort Order: Ascending order - Click to sort in descending order
No work has yet been logged on this issue.