lucene-java-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Michael McCandless <>
Subject Re: Lock obtain timed out
Date Wed, 26 Jul 2006 18:16:26 GMT
>> When I close my application containing index writers the
>> lock files are left in the temp directory causing an "Lock obtain
>> timed out" error upon the next restart.
> My guess is that you keep a writer open even though there is no activity
> involving adding new documents. Unless I have a massive never ending
> stream of new data arriving (many thousand per minute) I usually try not
> to have an open writer. Opening, adding documents and closing the writer
> in iterations.

It's also odd that you can repeat this so easily.  What OS/platform are 
you using?

The IndexWriter and IndexReader have their own finalizers to release 
(remove) the lock files.

Is it possible your JVM is exiting in a non-graceful manner (ie crashing)?

One known issue is Lucene just calls to remove the 
lock file, but doesn't check/confirm the returned result of this call 
that the file was actually deleted.  We are working on improving the 
locking by using native (OS) locks instead, which should correctly free 
lock files whenever the JVM process exits.  But this won't happen until 
a future Lucene release...


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

View raw message