You are viewing a plain text version of this content. The canonical link for it is here.
Posted to java-user@lucene.apache.org by Jed Wesley-Smith <je...@atlassian.com> on 2006/09/18 06:16:56 UTC

Possible exceptions using IndexReader & IndexWriter

all,

We're just wondering if anyone has seen any exceptions when using the 
IndexWriter.addDocument(...) or IndexReader.deleteDocuments(Term term) 
methods apart from catastrophic IOExceptions (disk full/failed etc.).

Is it possible for instance that we may be able to create a document 
that causes an exception when written? It doesn't seem to be possible, 
and we've never seen it happen, but we just to check with everyone  to 
see if anyone knows of such things.

-- 
cheers,
- jed.


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


Re: Possible exceptions using IndexReader & IndexWriter

Posted by Michael McCandless <lu...@mikemccandless.com>.
Jason Polites wrote:
> I've also seen FileNotFound exceptions when attempting a search on an index
> while it's being updated, and the searcher is in a different JVM.  This is
> supposed to be supported, but on Windows seems to regularly fail (for me
> anyway).

Note that this use case (accessing one shared Lucene index from
different JVMs even on different machines) is supposed to work, but
there are known issues on certain platforms/filesystems.

For example, see this post for recent progress on intermittent file
renaming errors some people hit on Windows:

     http://www.gossamer-threads.com/lists/lucene/java-user/39974

And see this for progress on getting Lucene to work over NFS (and
likely other remote filesystems):

     http://issues.apache.org/jira/browse/LUCENE-673

And finally we are working on small changes to Lucene's file format so
that the commit lock (a source of quite a few issues) is not necessary
("lock-less commits"), to prevent the various problems people have
with locking (and NFS!):

 
http://www.gossamer-threads.com/lists/lucene/java-dev/39112?do=post_view_threaded#39112

We would like to the bottom of all such low-level robustness cases so
if you are hitting unexplained exceptions that don't seem to fit into
one of these three cases (windows renaming errors; nfs errors; locking
errors) please reply to this!  Thanks.

Mike

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


Re: Possible exceptions using IndexReader & IndexWriter

Posted by Jason Polites <ja...@gmail.com>.
I've also seen FileNotFound exceptions when attempting a search on an index
while it's being updated, and the searcher is in a different JVM.  This is
supposed to be supported, but on Windows seems to regularly fail (for me
anyway).

The simplest solution to this would be a service oriented approach, using a
web service or RMI interface to the index.  Performance issues not
withstanding.

On 9/18/06, Yonik Seeley <yo...@apache.org> wrote:
>
> On 9/18/06, Jed Wesley-Smith <je...@atlassian.com> wrote:
> > We're just wondering if anyone has seen any exceptions when using the
> > IndexWriter.addDocument(...) or IndexReader.deleteDocuments(Term term)
> > methods apart from catastrophic IOExceptions (disk full/failed etc.).
>
> And out-of-memory exceptions.
>
> > Is it possible for instance that we may be able to create a document
> > that causes an exception when written?
>
> IndexWriter.addDocument invokes the analyzer you are using for indexed
> fields.  If any of the analyzers you are using can throw exceptions,
> that would bubble up.
>
> > It doesn't seem to be possible,
> > and we've never seen it happen, but we just to check with everyone  to
> > see if anyone knows of such things.
>
> It might be a very rare case in Windows that renaming a file can fail
> and result in an IOException.
>
>
> -Yonik
> http://incubator.apache.org/solr Solr, the open-source Lucene search
> server
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: java-user-unsubscribe@lucene.apache.org
> For additional commands, e-mail: java-user-help@lucene.apache.org
>
>

Re: Possible exceptions using IndexReader & IndexWriter

Posted by Yonik Seeley <yo...@apache.org>.
On 9/18/06, Jed Wesley-Smith <je...@atlassian.com> wrote:
> We're just wondering if anyone has seen any exceptions when using the
> IndexWriter.addDocument(...) or IndexReader.deleteDocuments(Term term)
> methods apart from catastrophic IOExceptions (disk full/failed etc.).

And out-of-memory exceptions.

> Is it possible for instance that we may be able to create a document
> that causes an exception when written?

IndexWriter.addDocument invokes the analyzer you are using for indexed
fields.  If any of the analyzers you are using can throw exceptions,
that would bubble up.

> It doesn't seem to be possible,
> and we've never seen it happen, but we just to check with everyone  to
> see if anyone knows of such things.

It might be a very rare case in Windows that renaming a file can fail
and result in an IOException.


-Yonik
http://incubator.apache.org/solr Solr, the open-source Lucene search server

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