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 18177] New: - IndexWriter ctor does not release lock on exception
Date Thu, 20 Mar 2003 01:26:17 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=18177>.
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=18177

IndexWriter ctor does not release lock on exception

           Summary: IndexWriter ctor does not release lock on exception
           Product: Lucene
           Version: 1.2
          Platform: All
        OS/Version: All
            Status: NEW
          Severity: Normal
          Priority: Other
         Component: Index
        AssignedTo: lucene-dev@jakarta.apache.org
        ReportedBy: zaphod@byzantine.no


If IndexWriter construction fails with an exception, the write.lock lock is not
released.

For example, this happens if one tries to open an IndexWriter on an FSDirectory
which does not contain an Lucene index. FileNotFoundException will be thrown by
org.apache.lucene.store.FSInputStream, after which the write lock will remain in
the directory, and nobody can open the index.

I have been using this pattern -- doing IndexWriter(..., false), catching
FileNotFoundException and doing IndexWriter(..., true) -- in my code to
initialize the index on demand, because the app never know if the index already
exists.

---------------------------------------------------------------------
To unsubscribe, e-mail: lucene-dev-unsubscribe@jakarta.apache.org
For additional commands, e-mail: lucene-dev-help@jakarta.apache.org


Mime
View raw message