Description
With OAK-6895 DefaultIndexReader now closes CopyOnReadDirectory used for suggestor multiple times. This leads to exception later
21.11.2017 13:53:52.750 *WARN* [oak-lucene-2162] org.apache.jackrabbit.oak.plugins.index.lucene.LuceneIndexProviderService Error occurred in asynchronous processing org.apache.lucene.store.AlreadyClosedException: this Directory is closed at org.apache.lucene.store.BaseDirectory.ensureOpen(BaseDirectory.java:66) at org.apache.lucene.store.FSDirectory.getDirectory(FSDirectory.java:338) at org.apache.jackrabbit.oak.plugins.index.lucene.directory.LocalIndexFile.getFSDir(LocalIndexFile.java:125) at org.apache.jackrabbit.oak.plugins.index.lucene.directory.LocalIndexFile.<init>(LocalIndexFile.java:43) at org.apache.jackrabbit.oak.plugins.index.lucene.IndexCopier.deleteFile(IndexCopier.java:276) at org.apache.jackrabbit.oak.plugins.index.lucene.directory.CopyOnReadDirectory.removeDeletedFiles(CopyOnReadDirectory.java:315) at org.apache.jackrabbit.oak.plugins.index.lucene.directory.CopyOnReadDirectory.access$300(CopyOnReadDirectory.java:51) at org.apache.jackrabbit.oak.plugins.index.lucene.directory.CopyOnReadDirectory$2.run(CopyOnReadDirectory.java:278) at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142) at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617) at java.lang.Thread.run(Thread.java:745)
As a fix
- Avoid closing the directory multiple times in DefaultIndexReader
- Make CopyOnReadDirectory resilient to multiple close calls
Attachments
Issue Links
- is broken by
-
OAK-6895 Suggest directory lookup (query) isn't closed
- Closed