Uploaded image for project: 'Jackrabbit Oak'
  1. Jackrabbit Oak
  2. OAK-6972

DefaultIndexReader closes suggest directory multiple times

    XMLWordPrintableJSON

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Minor
    • Resolution: Fixed
    • Affects Version/s: 1.7.11
    • Fix Version/s: 1.7.12, 1.8.0, 1.4.24, 1.6.16
    • Component/s: lucene
    • Labels:
      None

      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

      1. Avoid closing the directory multiple times in DefaultIndexReader
      2. Make CopyOnReadDirectory resilient to multiple close calls

        Attachments

          Issue Links

            Activity

              People

              • Assignee:
                chetanm Chetan Mehrotra
                Reporter:
                chetanm Chetan Mehrotra
              • Votes:
                0 Vote for this issue
                Watchers:
                2 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved: