Mailing List Archive

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: <mailto:lucene-dev-unsubscribe@jakarta.apache.org>
For additional commands, e-mail: <mailto:lucene-dev-help@jakarta.apache.org>