lucene-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From bugzi...@apache.org
Subject DO NOT REPLY [Bug 12749] New: - IndexReader.unlock() won't clear commit.lock if write.lock not present
Date Tue, 17 Sep 2002 21:25:01 GMT
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:   <mailto:lucene-dev-unsubscribe@jakarta.apache.org>
For additional commands, e-mail: <mailto:lucene-dev-help@jakarta.apache.org>


Mime
View raw message