lucene-java-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Claes Holmerson <>
Subject Lock failure recovery
Date Thu, 03 Feb 2005 17:02:07 GMT

A commit.lock can get left by a process that dies in the middle of 
reading the index, for example because of an OutOfMemoryError. How can I 
handle such a left lock gracefully the next time the process runs? 
Checking if there is a lock is straight forward - but how can I be sure 
that it is not just a current lock created by another thread? The only 
methods I find to deal with the lock is IndexReader.isLocked() and 
IndexReader.unlock(). I would like to know the lock age - if it is older 
than a certain age then I can remove it. How do other people deal with 
left over locks?


Claes Holmerson
Polopoly - Cultivating the information garden
Kungsgatan 88, SE-112 27 Stockholm, SWEDEN
Direct: +46 8 506 782 59
Mobile: +46 704 47 82 59
Fax:  +46 8 506 782 51,

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

View raw message