Another option is to switch to native locks (dir.setLockFactory(new NativeFSLockFactory()), at which point you will never have to call IndexReader.unLock because native locks are always properly released by the OS when the JVM exits/crashes.

If on switching to native locks, and removing the call to IndexReader.unlock, you see IndexWriter.open hitting LockObtainFailedException, then that means somehow you are trying to open two live writers on the same index.

Mike

Wojtek212 wrote:


Hi Mike,
I'm sharing one instance of IndexManager across all threads and as I've
noticed only this one is used during indexing.

I'm unlocking before every indexing operation to make sure it would be
possible.
When IndexWriter is closed I assume it releases the lock and finishes its
work.
Does IndexWriter executes some threads and doesn't wait when they are
finished?
It's the only one situation I can imagine that there 2 IndexWriters...


--
View this message in context: 
http://www.nabble.com/FileNotFoundException-during-indexing-tp18766343p18769652.html
Sent from the Lucene - Java Users mailing list archive at Nabble.com.


---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to