lucene-java-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Kevin L. Cobb" <>
Subject RE: Best way to purposely corrupt an index?
Date Wed, 20 Apr 2005 12:52:07 GMT
My policy on this type of exception handling is to only byte off what
you can chew. If you catch an IOException, then you simply report to the
user that an unexpected error has occurred and the search engine is
unobtainable at the moment. Errors should be logged and developers
should look at the specifics of the error to solve the issue. As you
implied, either it's a corrupted index, a permission problem, or another
access problem. 

Trying to attack the issue much deeper than this will sacrifice
development/maintenance time for very little payback in the end if you
expect this error to occur infrequently. 

-----Original Message-----
From: Andy Roberts [] 
Sent: Wednesday, April 20, 2005 5:43 AM
Subject: Re: Best way to purposely corrupt an index?

On Wednesday 20 Apr 2005 08:27, Maik Schreiber wrote:
> > As the index is rather critical to my program, I just wanted to make
> > really robust, and able to cope should a problem occur with the
> > itself. Otherwise, the user will be left with a non-functioning
> > with no explanation. That's my reasoning anyway.
> You should perhaps go about implementing an automatic index backup
> of some sort. In the case of index corruption you would at least be
able to
> go back to the latest backup.

Don't worry, I know what I intend to do *should* an error exist. My
post was about how to detect corrupt indexes, and also how to purposely 
corrupt an index for the purposes of testing.

Note, IndexReader throws IOExceptions, but, this could be for a
multitude of 
reasons, not just a corrupt index. I was rather hoping for a 
CorruptIndexException of some sort!

It looks to me that if I do get an IOException, I will then have to
perform a 
number of additional checks to eliminate the other possible causes of 
IOExceptions (such as permissions issues), and by a process of
determine a corrupt index.

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

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

View raw message