lucene-java-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Nikolay Diakov <nikolay.dia...@fredhopper.com>
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() {
     lockFile.delete();
   }

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.

Cheers,
   Nikolay

---------------------------------------------------------------------
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