lucene-java-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Michael McCandless <luc...@mikemccandless.com>
Subject Re: Lucene Javadoc Exception - cause?
Date Fri, 02 Feb 2007 10:14:17 GMT
Josh Joy wrote:

> I was implementing some calls to Lucene, though was
> curious if there was 
> some documentation I was missing that indicated why a
> method throws an 
> exception.
> 
> Example, IndexReader - deleteDocuments() - what is the
> root cause as to 
> why it throws IOException?
> 
> I'm trying to utilize this info to determine my
> exception handling 
> strategy for all my Lucene API calls (should I fail,
> retry, ignore, etc)

I agree we don't have enough documentation around why an IOException
might be thrown for the various Lucene methods.

For your example (IndexReader.deleteDocuments) there are some
"interesting" cases that I think we should call out:

   * Another "writer" (IndexWriter or IndexReader with pending deletes)
     is already open against the index (this will be the "Lock obtain
     timed out" IOException).

   * The reader is "stale" meaning another writer has committed changes
     to the index since this reader was opened.

Then of course index corruption, transient IO problems, permission
problems, etc, can lead to IOExceptions.

I will open a JIRA issue.

Mike

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