You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@lucene.apache.org by bu...@apache.org on 2002/09/17 23:25:01 UTC

DO NOT REPLY [Bug 12749] New: - IndexReader.unlock() won't clear commit.lock if write.lock not present

DO NOT REPLY TO THIS EMAIL, BUT PLEASE POST YOUR BUG 
RELATED COMMENTS THROUGH THE WEB INTERFACE AVAILABLE AT
<http://nagoya.apache.org/bugzilla/show_bug.cgi?id=12749>.
ANY REPLY MADE TO THIS MESSAGE WILL NOT BE COLLECTED AND 
INSERTED IN THE BUG DATABASE.

http://nagoya.apache.org/bugzilla/show_bug.cgi?id=12749

IndexReader.unlock() won't clear commit.lock if write.lock not present

           Summary: IndexReader.unlock() won't clear commit.lock if
                    write.lock not present
           Product: Lucene
           Version: 1.2
          Platform: All
        OS/Version: Windows NT/2K
            Status: NEW
          Severity: Minor
          Priority: Other
         Component: Store
        AssignedTo: lucene-dev@jakarta.apache.org
        ReportedBy: pkammer@endeavors.com


IndexReader.unlock() calls Directory.deleteFile() for write.lock and 
commit.lock in succession, presumably to clear both locks.  However, if 
write.lock doesn't exist, FSDirectory will throw an IOException, preventing the 
second deletefile from getting called and potentially leaving the commit.lock.

    public static void unlock(Directory directory) throws IOException {
	directory.deleteFile("write.lock");
	directory.deleteFile("commit.lock");

Added note:
Since IndexReader.isLocked() only checks for the write.lock, there's no way 
programmatically to assure that the commit.lock is not set without breaking the 
API abstraction and looking for it in the Directory object by name.

--
To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>