lucene-java-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Otis Gospodnetic <>
Subject Re: Lock handling
Date Wed, 25 Aug 2004 08:28:48 GMT

If you use Lucene incorrectly (e.g. 2 IndexWriters writing to the same
index), you will see this error.  Lucene has no way of telling whether
the lock file was left over from a previous process, or whether it's a
valid lock file because another process is currently indexing documents
or some such.
You could try adding some logic to your app, though.  For instance, you
can look at lock's timestamp, and using IndexReader.unlock(...) method
to forcefully unlock the index.


--- Claes Holmerson <> wrote:

> Hello,
> I am interested to hear how people handle locked indexes, for example
> when catching an IOException like below.
> Lock obtain timed out:
> Lock@/tmp/lucene-0b978f2c0aa12e8dcdbd5b0df491bfc4-write.lock
>         at
>         at
> org.apache.lucene.index.IndexWriter.<init>(
>         at
> org.apache.lucene.index.IndexWriter.<init>(
> As far as I can tell, there is no good way to tell whether the lock
> is 
> only temporary (working as it should), or if it was created by a
> process 
> that later died, and therefore can not remove it. How can I detect
> the 
> latter case, and how should I best handle it?
> Thanks,
> Claes
> ---------------------------------------------------------------------
> To unsubscribe, e-mail:
> For additional commands, e-mail:

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

View raw message