Hi Guys,

So I’m seeing a problem in production that is very bizarre and I wanted to see 
if anyone else has encountered this issue and/or has a suggestion or fix. Here 
goes:

We create a wrapper around an index and searcher manager to encapsulate both. 
First we create the IndexWriter and then immediately after create the 
SearcherManager, like this:

indexWriter = new IndexWriter(indexDirectory, getWriterConfig());
searcherManager = new SearcherManager(indexWriter, true, new 
ExecutorSearcherFactory());


During construction of the SearcherManager this is thrown:

Caused by: org.apache.lucene.store.AlreadyClosedException: this IndexWriter is 
closed
        at org.apache.lucene.index.IndexWriter.ensureOpen(IndexWriter.java:766)
        at 
org.apache.lucene.index.IndexWriter.getDirectory(IndexWriter.java:1909)
        at 
com.triagewireless.h1s.session.data.index.LuceneIndexMergeScheduler.getIndexDirectory(LuceneIndexMergeScheduler.java:162)
        at 
com.triagewireless.h1s.session.data.index.LuceneIndexMergeScheduler.access$000(LuceneIndexMergeScheduler.java:31)
        at 
com.triagewireless.h1s.session.data.index.LuceneIndexMergeScheduler$MergeTask.equals(LuceneIndexMergeScheduler.java:127)
        at 
java.util.concurrent.ArrayBlockingQueue.contains(ArrayBlockingQueue.java:497)
        at 
com.triagewireless.h1s.session.data.index.LuceneIndexMergeScheduler.merge(LuceneIndexMergeScheduler.java:148)
        at org.apache.lucene.index.IndexWriter.maybeMerge(IndexWriter.java:2740)
        at org.apache.lucene.index.IndexWriter.maybeMerge(IndexWriter.java:2734)
        at org.apache.lucene.index.IndexWriter.getReader(IndexWriter.java:457)
        at org.apache.lucene.index.IndexWriter.getReader(IndexWriter.java:399)
        at org.apache.lucene.index.IndexReader.open(IndexReader.java:296)
        at 
org.apache.lucene.search.SearcherManager.<init>(SearcherManager.java:82)
        at 
com.triagewireless.h1s.session.data.index.LuceneIndex.initNoCache(LuceneIndex.java:312)
        
        at 
com.triagewireless.h1s.session.data.index.LuceneIndex.init(LuceneIndex.java:270)
        at sun.reflect.GeneratedMethodAccessor45.invoke(Unknown Source)
        at 
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
        at java.lang.reflect.Method.invoke(Method.java:606)
        at 
org.springframework.beans.factory.annotation.InitDestroyAnnotationBeanPostProcessor$LifecycleElement.invoke(InitDestroyAnnotationBeanPostProcessor.java:346)
        at 
org.springframework.beans.factory.annotation.InitDestroyAnnotationBeanPostProcessor$LifecycleMetadata.invokeInitMethods(InitDestroyAnnotationBeanPostProcessor.java:299)
        at 
org.springframework.beans.factory.annotation.InitDestroyAnnotationBeanPostProcessor.postProcessBeforeInitialization(InitDestroyAnnotationBeanPostProcessor.java:132)
        ... 57 more


Why? No other threads are acting on this index, etc. The index writer was just 
created so how could it already be closed? 

I’m completely baffled on this one guys… so many thanks in advance for your 
help! I’ll take any suggestions on a possible mitigation too if anyone thinks 
of any. 


Blessings, 
Brian Call 
Manager, Systems Software Development   
Work: +1 (619) 373-4840 | Cell: +1 (619) 344-1013

 <http://soterawireless.com/>                   Sotera Wireless, Inc.
10020 Huennekens Street San Diego, CA 92121, USA
Phone: +1 (858) 427-4620 | Fax: +1 (858) 999-2487

PRIVILEGED AND CONFIDENTIAL COMMUNICATION: This electronic transmission, and 
any documents attached hereto, may contain confidential and/or legally 
privileged information. The information is intended only for use by the 
recipient named above. If you have received this electronic message in error, 
please notify the sender and delete the electronic message. Any disclosure, 
copying, distribution, or use of the contents of information received in error 
is strictly prohibited.

Reply via email to