lucene-java-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Nikolay Diakov <>
Subject - lock improvement suggestion
Date Fri, 09 Nov 2007 15:17:58 GMT
I have briefly reviewed the SimpleFSLock of Lucene 2.1 and 2.2. I see 
that the lock release mechanism does not check the return value of delete:

   public void release() {

On most linux-es this can never return false, however under some windows 
FS if someone (a virus scanner) touches the file at the proper 
(improper) time, one may get a delete failure and get a false value. In 
the original code this means that the directory stays locked forever 
(unless someone does double unlocking or until a clearLock from the lock 
factory). For diagnosting purposes, it may be a good idea to throw an 
exception in that case. Alternatively, release() may return a boolean up 
the chain, however this may require more changes in the code using the 
release(). Just a suggestion.


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

View raw message