Uploaded image for project: 'Solr'
  1. Solr
  2. SOLR-2247

ClosedChannelException throws on Linux

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Major
    • Resolution: Not A Problem
    • Affects Version/s: None
    • Fix Version/s: None
    • Component/s: search
    • Labels:
      None
    • Environment:

      JDK1.6/Tomcat6

      Description

      i use distributed query, but found ClosedChannelException.

      Caused by: java.nio.channels.ClosedChannelException
              at sun.nio.ch.FileChannelImpl.ensureOpen(FileChannelImpl.java:88)
              at sun.nio.ch.FileChannelImpl.read(FileChannelImpl.java:613)
              at org.apache.lucene.store.NIOFSDirectory$NIOFSIndexInput.readInternal(NIOFSDirectory.java:161)
              at org.apache.lucene.store.BufferedIndexInput.readBytes(BufferedIndexInput.java:139)
              at org.apache.lucene.index.CompoundFileReader$CSIndexInput.readInternal(CompoundFileReader.java:285)
              at org.apache.lucene.store.BufferedIndexInput.refill(BufferedIndexInput.java:160)
              at org.apache.lucene.store.BufferedIndexInput.readByte(BufferedIndexInput.java:39)
              at org.apache.lucene.store.DataInput.readVInt(DataInput.java:86)
              at org.apache.lucene.index.codecs.DeltaBytesReader.read(DeltaBytesReader.java:40)
              at org.apache.lucene.index.codecs.PrefixCodedTermsReader$FieldReader$SegmentTermsEnum.next(PrefixCodedTermsReader.java:469)
              at org.apache.lucene.index.codecs.PrefixCodedTermsReader$FieldReader$SegmentTermsEnum.seek(PrefixCodedTermsReader.java:385)
              at org.apache.lucene.index.TermsEnum.seek(TermsEnum.java:68)
              at org.apache.lucene.index.Terms.docFreq(Terms.java:53)
              at org.apache.lucene.index.SegmentReader.docFreq(SegmentReader.java:898)
              at org.apache.lucene.index.IndexReader.docFreq(IndexReader.java:882)
              at org.apache.lucene.index.DirectoryReader.docFreq(DirectoryReader.java:687)
              at org.apache.solr.search.SolrIndexReader.docFreq(SolrIndexReader.java:305)
              at org.apache.lucene.search.IndexSearcher.docFreq(IndexSearcher.java:136)
              at org.apache.lucene.search.Similarity.idfExplain(Similarity.java:804)
              at org.apache.lucene.search.PhraseQuery$PhraseWeight.<init>(PhraseQuery.java:150)
              at org.apache.lucene.search.PhraseQuery.createWeight(PhraseQuery.java:321)
              at org.apache.lucene.search.Query.weight(Query.java:101)
              at org.apache.lucene.search.Searcher.createWeight(Searcher.java:147)
              at org.apache.lucene.search.Searcher.search(Searcher.java:88)
              at org.apache.solr.search.SolrIndexSearcher.getDocListNC(SolrIndexSearcher.java:1388)
              at org.apache.solr.search.SolrIndexSearcher.getDocListC(SolrIndexSearcher.java:1284)
              at org.apache.solr.search.SolrIndexSearcher.search(SolrIndexSearcher.java:343)
              at org.apache.solr.handler.component.QueryComponent.process(QueryComponent.java:
              ...
      

      with lucene-2239, i found NIOFs would throw ClosedChannelException.
      see https://issues.apache.org/jira/browse/LUCENE-2239

        Activity

        Hide
        simonw Simon Willnauer added a comment -

        There we go... what a crap!

        there are a couple of suspicious Future#cancel() in SearchHandler.java and DirectUpdateHandler2.java

        fun!

        Show
        simonw Simon Willnauer added a comment - There we go... what a crap! there are a couple of suspicious Future#cancel() in SearchHandler.java and DirectUpdateHandler2.java fun!
        Hide
        simonw Simon Willnauer added a comment -

        As uwe pointed out correctly on IRC that problem might be somewhat "solvable" if you use MMapDirectory since it only with run into this exception when you open the files initially. Once that is done its mapped and you should be fine. Yet, it somewhat requires 64 JVMs.

        just a hint...

        Show
        simonw Simon Willnauer added a comment - As uwe pointed out correctly on IRC that problem might be somewhat "solvable" if you use MMapDirectory since it only with run into this exception when you open the files initially. Once that is done its mapped and you should be fine. Yet, it somewhat requires 64 JVMs. just a hint...
        Hide
        tom_lt tom liu added a comment -

        yes,after i use JAVA_OPTS="$JAVA_OPTS -Dsolr.directoryFactory=solr.MMapDirectoryFactory", i do not catch the CCE.

        thx

        Show
        tom_lt tom liu added a comment - yes,after i use JAVA_OPTS="$JAVA_OPTS -Dsolr.directoryFactory=solr.MMapDirectoryFactory", i do not catch the CCE. thx

          People

          • Assignee:
            Unassigned
            Reporter:
            tom_lt tom liu
          • Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved:

              Development