java.nio.channels.ClosedChannelException

Apache's JIRA Issue Tracker | Shalin Shekhar Mangar | 2 years ago
  1. 0

    If a node is partitioned from ZooKeeper for an extended period of time then upon resuming connection, the node re-registers itself causing recoverFromLog() method to be executed which fails with the following exception: {code} 8091124 [Thread-71] ERROR org.apache.solr.update.UpdateLog – Error inspecting tlog tlog{file=/home/ubuntu/shalin-lusolr/solr/example/solr/collection_5x3_shard5_replica3/data/tlog/tlog.0000000000000009869 refcount=2} java.nio.channels.ClosedChannelException at sun.nio.ch.FileChannelImpl.ensureOpen(FileChannelImpl.java:99) at sun.nio.ch.FileChannelImpl.read(FileChannelImpl.java:678) at org.apache.solr.update.ChannelFastInputStream.readWrappedStream(TransactionLog.java:784) at org.apache.solr.common.util.FastInputStream.refill(FastInputStream.java:89) at org.apache.solr.common.util.FastInputStream.read(FastInputStream.java:125) at java.io.InputStream.read(InputStream.java:101) at org.apache.solr.update.TransactionLog.endsWithCommit(TransactionLog.java:218) at org.apache.solr.update.UpdateLog.recoverFromLog(UpdateLog.java:800) at org.apache.solr.cloud.ZkController.register(ZkController.java:834) at org.apache.solr.cloud.ZkController$1.command(ZkController.java:271) at org.apache.solr.common.cloud.ConnectionManager$1$1.run(ConnectionManager.java:166) 8091125 [Thread-71] ERROR org.apache.solr.update.UpdateLog – Error inspecting tlog tlog{file=/home/ubuntu/shalin-lusolr/solr/example/solr/collection_5x3_shard5_replica3/data/tlog/tlog.0000000000000009870 refcount=2} java.nio.channels.ClosedChannelException at sun.nio.ch.FileChannelImpl.ensureOpen(FileChannelImpl.java:99) at sun.nio.ch.FileChannelImpl.read(FileChannelImpl.java:678) at org.apache.solr.update.ChannelFastInputStream.readWrappedStream(TransactionLog.java:784) at org.apache.solr.common.util.FastInputStream.refill(FastInputStream.java:89) at org.apache.solr.common.util.FastInputStream.read(FastInputStream.java:125) at java.io.InputStream.read(InputStream.java:101) at org.apache.solr.update.TransactionLog.endsWithCommit(TransactionLog.java:218) at org.apache.solr.update.UpdateLog.recoverFromLog(UpdateLog.java:800) at org.apache.solr.cloud.ZkController.register(ZkController.java:834) at org.apache.solr.cloud.ZkController$1.command(ZkController.java:271) at org.apache.solr.common.cloud.ConnectionManager$1$1.run(ConnectionManager.java:166) {code} This is because the recoverFromLog uses transaction log references that were collected at startup and are no longer valid. We shouldn't even be running recoverFromLog code for ZK re-connect.

    Apache's JIRA Issue Tracker | 2 years ago | Shalin Shekhar Mangar
    java.nio.channels.ClosedChannelException
  2. 0

    If a node is partitioned from ZooKeeper for an extended period of time then upon resuming connection, the node re-registers itself causing recoverFromLog() method to be executed which fails with the following exception: {code} 8091124 [Thread-71] ERROR org.apache.solr.update.UpdateLog – Error inspecting tlog tlog{file=/home/ubuntu/shalin-lusolr/solr/example/solr/collection_5x3_shard5_replica3/data/tlog/tlog.0000000000000009869 refcount=2} java.nio.channels.ClosedChannelException at sun.nio.ch.FileChannelImpl.ensureOpen(FileChannelImpl.java:99) at sun.nio.ch.FileChannelImpl.read(FileChannelImpl.java:678) at org.apache.solr.update.ChannelFastInputStream.readWrappedStream(TransactionLog.java:784) at org.apache.solr.common.util.FastInputStream.refill(FastInputStream.java:89) at org.apache.solr.common.util.FastInputStream.read(FastInputStream.java:125) at java.io.InputStream.read(InputStream.java:101) at org.apache.solr.update.TransactionLog.endsWithCommit(TransactionLog.java:218) at org.apache.solr.update.UpdateLog.recoverFromLog(UpdateLog.java:800) at org.apache.solr.cloud.ZkController.register(ZkController.java:834) at org.apache.solr.cloud.ZkController$1.command(ZkController.java:271) at org.apache.solr.common.cloud.ConnectionManager$1$1.run(ConnectionManager.java:166) 8091125 [Thread-71] ERROR org.apache.solr.update.UpdateLog – Error inspecting tlog tlog{file=/home/ubuntu/shalin-lusolr/solr/example/solr/collection_5x3_shard5_replica3/data/tlog/tlog.0000000000000009870 refcount=2} java.nio.channels.ClosedChannelException at sun.nio.ch.FileChannelImpl.ensureOpen(FileChannelImpl.java:99) at sun.nio.ch.FileChannelImpl.read(FileChannelImpl.java:678) at org.apache.solr.update.ChannelFastInputStream.readWrappedStream(TransactionLog.java:784) at org.apache.solr.common.util.FastInputStream.refill(FastInputStream.java:89) at org.apache.solr.common.util.FastInputStream.read(FastInputStream.java:125) at java.io.InputStream.read(InputStream.java:101) at org.apache.solr.update.TransactionLog.endsWithCommit(TransactionLog.java:218) at org.apache.solr.update.UpdateLog.recoverFromLog(UpdateLog.java:800) at org.apache.solr.cloud.ZkController.register(ZkController.java:834) at org.apache.solr.cloud.ZkController$1.command(ZkController.java:271) at org.apache.solr.common.cloud.ConnectionManager$1$1.run(ConnectionManager.java:166) {code} This is because the recoverFromLog uses transaction log references that were collected at startup and are no longer valid. We shouldn't even be running recoverFromLog code for ZK re-connect.

    Apache's JIRA Issue Tracker | 2 years ago | Shalin Shekhar Mangar
    java.nio.channels.ClosedChannelException
  3. Speed up your debug routine!

    Automated exception search integrated into your IDE

  4. 0

    4.10.4 - nodes up, shard without leader

    lucene-solr-user | 2 years ago | Markus Jelsma
    java.nio.channels.ClosedChannelException
  5. 0

    Issue 3956 - gerrit - Gerrit server 2.11.5 hang repeatedly due to Lucence index "ClosedChannelException" - Gerrit Code Review - Google Project Hosting

    google.com | 8 months ago
    com.google.gwtorm.server.OrmException: java.io.IOException: null: NIOFSIndexInput(path="/home/gerrit/review_site/index/changes_0025/open/_9y_Lucene50_0.tim")

    1 unregistered visitors
    Not finding the right solution?
    Take a tour to get the most out of Samebug.

    Tired of useless tips?

    Automated exception search integrated into your IDE

    Root Cause Analysis

    1. java.nio.channels.ClosedChannelException

      No message provided

      at sun.nio.ch.FileChannelImpl.ensureOpen()
    2. Java RT
      FileChannelImpl.read
      1. sun.nio.ch.FileChannelImpl.ensureOpen(FileChannelImpl.java:99)
      2. sun.nio.ch.FileChannelImpl.read(FileChannelImpl.java:678)
      2 frames
    3. Apache Solr Core
      ChannelFastInputStream.readWrappedStream
      1. org.apache.solr.update.ChannelFastInputStream.readWrappedStream(TransactionLog.java:784)
      1 frame
    4. Apache Solr Solrj
      FastInputStream.read
      1. org.apache.solr.common.util.FastInputStream.refill(FastInputStream.java:89)
      2. org.apache.solr.common.util.FastInputStream.read(FastInputStream.java:125)
      2 frames
    5. Java RT
      InputStream.read
      1. java.io.InputStream.read(InputStream.java:101)
      1 frame
    6. Apache Solr Core
      ZkController$1.command
      1. org.apache.solr.update.TransactionLog.endsWithCommit(TransactionLog.java:218)
      2. org.apache.solr.update.UpdateLog.recoverFromLog(UpdateLog.java:800)
      3. org.apache.solr.cloud.ZkController.register(ZkController.java:834)
      4. org.apache.solr.cloud.ZkController$1.command(ZkController.java:271)
      4 frames
    7. Apache Solr Solrj
      ConnectionManager$1$1.run
      1. org.apache.solr.common.cloud.ConnectionManager$1$1.run(ConnectionManager.java:166)
      1 frame