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: 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  
called).

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.

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