Uploaded image for project: 'Lucene - Core'
  1. Lucene - Core
  2. LUCENE-8262

NativeFSLockFactory loses the channel when a thread is interrupted and the SolrCore becomes unusable after

    XMLWordPrintableJSON

    Details

    • Type: Bug
    • Status: Resolved
    • Priority: Minor
    • Resolution: Won't Fix
    • Affects Version/s: 7.1.1
    • Fix Version/s: None
    • Component/s: None
    • Lucene Fields:
      New

      Description

      The condition is rare for us and seems basically a race.  If a thread that is running just happens to have the FileChannel open for NativeFSLockFactory and is interrupted, the channel is closed since it extends AbstractInterruptibleChannel

      Unfortunately this means the Solr Core has to be unloaded and reopened to make the core usable again as the ensureValid check forever throws an exception after.

      org.apache.lucene.store.AlreadyClosedException: FileLock invalidated by an external force: NativeFSLock(path=data/index/write.lock,impl=sun.nio.ch.FileLockImpl[0:9223372036854775807 exclusive invalid],creationTime=2018-04-06T21:45:11Z) at org.apache.lucene.store.NativeFSLockFactory$NativeFSLock.ensureValid(NativeFSLockFactory.java:178) at org.apache.lucene.store.LockValidatingDirectoryWrapper.createOutput(LockValidatingDirectoryWrapper.java:43) at org.apache.lucene.store.TrackingDirectoryWrapper.createOutput(TrackingDirectoryWrapper.java:43) at org.apache.lucene.codecs.compressing.CompressingStoredFieldsWriter.<init>(CompressingStoredFieldsWriter.java:113) at org.apache.lucene.codecs.compressing.CompressingStoredFieldsFormat.fieldsWriter(CompressingStoredFieldsFormat.java:128) at org.apache.lucene.codecs.lucene50.Lucene50StoredFieldsFormat.fieldsWriter(Lucene50StoredFieldsFormat.java:183)

       

      Proposed solution is using AsynchronousFileChannel instead, since this is only operating on a lock and .size method

        Attachments

          Activity

            People

            • Assignee:
              erickerickson Erick Erickson
              Reporter:
              millerjeff0 Jeff Miller
            • Votes:
              0 Vote for this issue
              Watchers:
              9 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved:

                Time Tracking

                Estimated:
                Original Estimate - 24h
                24h
                Remaining:
                Time Spent - 20m Remaining Estimate - 23h 40m
                23h 40m
                Logged:
                Time Spent - 20m Remaining Estimate - 23h 40m
                20m