We recently upgrade our lucene library from 1.9.1 to 3.6.1 and we run into multiple AlreadyClosedException when doing search. Here is the stack:
RetrievedDateMarker=2012-11-08 08:36:34.393 Error searching \\p7na02b\na01_mail03\index\daily\20121031.main.index.3 com.seccas.task.SearchRequestTask.futureTaskRun( SearchRequestTask.java:136) com.seccas.util.SearchThread.run(SearchThread.java:26) Caused by: org.apache.lucene.store.AlreadyClosedException: MMapIndexInput already closed: MMapIndexInput(path="\\p7na02b\na01_mail03\ compliance.farmersagent.com\index\daily\20121031.main.index.3\_4ljc.frq") org.apache.lucene.store.MMapDirectory$MMapIndexInput.seek(MMapDirectory.java:382) org.apache.lucene.index.SegmentTermDocs.seek(SegmentTermDocs.java:100) org.apache.lucene.index.SegmentTermDocs.seek(SegmentTermDocs.java:67) com.seccas.lucene.FieldArrayFilter.getDocIdSet(FieldArrayFilter.java:157) org.apache.lucene.search.FilteredQuery.getFilteredScorer(FilteredQuery.java:136) org.apache.lucene.search.IndexSearcher.search(IndexSearcher.java:577) org.apache.lucene.search.IndexSearcher.search(IndexSearcher.java:364) com.seccas.task.SearchRequestTask.futureTaskRun( SearchRequestTask.java:89) com.seccas.util.SearchThread.run(SearchThread.java:26) On the source code side, we open and did the search like this: reader = IndexReader.open(FSDirectory.open(newFile(request.indexPath))); searcher = new IndexSearcher( reader ); searcher.search( query, filter, collector ); I do not see any reason why this could happen. The IndexReader is not being shared with other thread. Regards -- Bin Lan Software Developer Perimeter E-Security O - (203)541-3412 Follow Us on Twitter: www.twitter.com/PerimeterNews Read Our Blog: security.perimeterusa.com/blog -- The sender of this email subscribes to Perimeter E-Security's email anti-virus service. This email has been scanned for malicious code and is believed to be virus free. For more information on email security please visit: http://www.perimeterusa.com/services/messaging This communication is confidential, intended only for the named recipient(s) above and may contain trade secrets or other information that is exempt from disclosure under applicable law. Any use, dissemination, distribution or copying of this communication by anyone other than the named recipient(s) is strictly prohibited. If you have received this communication in error, please delete the email and immediately notify our Command Center at 203-541-3444.