Uploaded image for project: 'Confluence Data Center'
  1. Confluence Data Center
  2. CONFSERVER-73593

In Confluence, Lucene connection uses NIOFSDirectory implementation rather then MMapDirectory in Java 11

XMLWordPrintable

      Issue Summary

      Confluence Lucene connection uses NIOFSDirectory implementation rather than MMapDirectory in Java 11

      Steps to Reproduce

      1. Install any Confluence version above 7.X that has support for Java 11
      2. The underlying Lucene uses NIOFSDirectory implementation rather than MMapDirectory which is more efficient

      Expected Results

      Confluence should use MMapDirectory with Java 11 as it was with Java 8

      Actual Results

      Confluence uses NIOFS implementation . This can result in multiple outcomes

      1. At scale, this method can be notably less performant for index lookups and searches
      2. Conditionally this results in situations where customers are presented with below error that requires a restart of the instance
        aused by: java.io.IOException: null: NIOFSIndexInput(_f2fd_Lucene41_0.tim in path="/var/atlassian/application-data/confluence/index/_f2fd.cfs" slice=2604086:9597840)
        	at org.apache.lucene.store.NIOFSDirectory$NIOFSIndexInput.readInternal(NIOFSDirectory.java:191)
        	... 143 more
        Caused by: java.nio.channels.ClosedByInterruptException
        

        This is a known behaviour for NIOFS class https://lucene.apache.org/core/3_5_0/api/all/org/apache/lucene/store/NIOFSDirectory.html

        • NOTE: Accessing this class either directly or indirectly from a thread while it's interrupted can close the underlying file descriptor immediately if at the same time the thread is blocked on IO. The file descriptor will remain closed and subsequent access to NIOFSDirectory will throw a ClosedChannelException. If your application uses either Thread.interrupt() or Future.cancel(boolean) you should use SimpleFSDirectory in favor of NIOFSDirectory.

      Workaround

      Downgrade to Java 8

              Unassigned Unassigned
              akotha@atlassian.com Ashish Kotha
              Votes:
              7 Vote for this issue
              Watchers:
              25 Start watching this issue

                Created:
                Updated:
                Resolved: