Re: Serious Index Corruption Error - FileNotFoundException

2008-05-08 Thread Michael McCandless
It would make me nervous to have Lucene insert that shutdown hook. EG closing the IndexWriter could in general be a time-consuming process. But if it's working for you, that's great. Though, if you explicitly kill the JVM (eg kill -9) those shutdown hooks won't run. You should use org.

Re: Serious Index Corruption Error - FileNotFoundException

2008-05-08 Thread Jamie
Hi Michael I had in fact preempted you and moved the delete lock code to a startup function. However, I found a nice little optimization that seems to force the writer to close when the process is manually killed. I added a JVM shutdown hook (i.e. using Runtime.getRuntime().addShutdownHook(thi

Re: Serious Index Corruption Error - FileNotFoundException

2008-05-08 Thread Michael McCandless
OK, that sounds like a legitimate reason to forcibly remove the write lock, but it would be better to do that only on startup of your process rather than in every openIndex() call. If ever you hit LockObtainFailedException in openIndex, even after having deleted the write lock on startup,

Re: Serious Index Corruption Error - FileNotFoundException

2008-05-08 Thread Jamie
Hi Mike Thanks for the suggestions. I've implemented all of them. The main reason why I manually deleted the lock file was that sometimes users kill the server process manually or there is a hard reboot without any warning. In such circumstances, Lucene leaves a lock file lying around as it w

Re: Serious Index Corruption Error - FileNotFoundException

2008-05-07 Thread Chris Hostetter
http://people.apache.org/~hossman/#threadhijack Thread Hijacking on Mailing Lists When starting a new discussion on a mailing list, please do not reply to an existing message, instead start a fresh email. Even if you change the subject line of your email, other mail headers still track which

Re: Serious Index Corruption Error - FileNotFoundException

2008-05-07 Thread Michael McCandless
On quickly looking through the code I think there are some serious hazards that could lead to this exception. First, in your openIndex code, if you hit a LockObtainFailedException in trying to open your writer, you are forcefully removing the write lock and then retrying. Yet, you also o