lucene-java-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Michael McCandless <>
Subject Re: FileNotFoundException during indexing
Date Fri, 01 Aug 2008 09:42:33 GMT

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.

OK, maybe triple check this -- because that's the only way in your  
code I can see 2 IWs being live at once.

> I'm unlocking before every indexing operation to make sure it would be
> possible.

This is what makes me nervous (and why I suggest you print every time  
IndexReader.isLocked returns true, to be 100% sure it's not being  

You should only very very rarely (after a JVM crash, or, if the JVM  
exits but you didn't close your IndexWriter) actually need to use  
IndexReader.unLock, and if you call it when you shouldn't (because  
another IW is in fact still "live"), disaster ensues.

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

Before close() returns it finishes all threads and releases the lock.


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

View raw message