java.nio.channels.ClosedChannelException

JIRA | Ron Siemens | 4 years ago
  1. 0

    I am occasionally but consistently getting ClosedChannelException. It seems to be on the service side message handling code, before deserializing according to my trials. The stack trace I get is below. I'm not sure if it's normal to get this now and again. But the problem is I also can't detect / respond to this. The associated Future's has isCompleted() = false, isDone() = false, and the get() function just hangs indefinitely, rather than giving an ExecutionException as I might expect, so this exception seems to be getting lost somewhere. Note, I tried upgrading the netty jar to 3.2.9 and also protobuf to 2.4.1, but got the same problem. 10:39:07 [norbert-message-executor-thread-4] INFO netty.ServerChannelHandler - Caught exception in channel: [id: 0x037b9c77, /10.1.5.150:60030 :> /10.1.5.150:3940] java.nio.channels.ClosedChannelException at org.jboss.netty.channel.socket.nio.NioWorker.cleanUpWriteBuffer(NioWorker.java:637) at org.jboss.netty.channel.socket.nio.NioWorker.writeFromUserCode(NioWorker.java:370) at org.jboss.netty.channel.socket.nio.NioServerSocketPipelineSink.handleAcceptedSocket(NioServerSocketPipelineSink.java:137) at org.jboss.netty.channel.socket.nio.NioServerSocketPipelineSink.eventSunk(NioServerSocketPipelineSink.java:76) at org.jboss.netty.channel.Channels.write(Channels.java:632) at org.jboss.netty.handler.codec.oneone.OneToOneEncoder.handleDownstream(OneToOneEncoder.java:70) at org.jboss.netty.channel.Channels.write(Channels.java:632) at org.jboss.netty.handler.codec.oneone.OneToOneEncoder.handleDownstream(OneToOneEncoder.java:70) at org.jboss.netty.channel.Channels.write(Channels.java:632) at org.jboss.netty.handler.codec.oneone.OneToOneEncoder.handleDownstream(OneToOneEncoder.java:70) at com.linkedin.norbert.network.netty.ServerFilterChannelHandler.handleDownstream(ServerChannelHandler.scala:86) at org.jboss.netty.channel.Channels.write(Channels.java:611) at org.jboss.netty.channel.Channels.write(Channels.java:578) at org.jboss.netty.channel.AbstractChannel.write(AbstractChannel.java:259) at com.linkedin.norbert.network.netty.ServerChannelHandler.responseHandler(ServerChannelHandler.scala:163) at com.linkedin.norbert.network.netty.ServerChannelHandler$$anonfun$messageReceived$1.apply(ServerChannelHandler.scala:138) at com.linkedin.norbert.network.netty.ServerChannelHandler$$anonfun$messageReceived$1.apply(ServerChannelHandler.scala:137) at com.linkedin.norbert.network.server.ThreadPoolMessageExecutor$RequestRunner$$anonfun$run$3.apply(MessageExecutorComponent.scala:152) at com.linkedin.norbert.network.server.ThreadPoolMessageExecutor$RequestRunner$$anonfun$run$3.apply(MessageExecutorComponent.scala:151) at scala.Option.foreach(Option.scala:185) at com.linkedin.norbert.network.server.ThreadPoolMessageExecutor$RequestRunner.run(MessageExecutorComponent.scala:151) at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1110) at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:603) at java.lang.Thread.run(Thread.java:722)

    JIRA | 4 years ago | Ron Siemens
    java.nio.channels.ClosedChannelException
  2. 0

    I am occasionally but consistently getting ClosedChannelException. It seems to be on the service side message handling code, before deserializing according to my trials. The stack trace I get is below. I'm not sure if it's normal to get this now and again. But the problem is I also can't detect / respond to this. The associated Future's has isCompleted() = false, isDone() = false, and the get() function just hangs indefinitely, rather than giving an ExecutionException as I might expect, so this exception seems to be getting lost somewhere. Note, I tried upgrading the netty jar to 3.2.9 and also protobuf to 2.4.1, but got the same problem. 10:39:07 [norbert-message-executor-thread-4] INFO netty.ServerChannelHandler - Caught exception in channel: [id: 0x037b9c77, /10.1.5.150:60030 :> /10.1.5.150:3940] java.nio.channels.ClosedChannelException at org.jboss.netty.channel.socket.nio.NioWorker.cleanUpWriteBuffer(NioWorker.java:637) at org.jboss.netty.channel.socket.nio.NioWorker.writeFromUserCode(NioWorker.java:370) at org.jboss.netty.channel.socket.nio.NioServerSocketPipelineSink.handleAcceptedSocket(NioServerSocketPipelineSink.java:137) at org.jboss.netty.channel.socket.nio.NioServerSocketPipelineSink.eventSunk(NioServerSocketPipelineSink.java:76) at org.jboss.netty.channel.Channels.write(Channels.java:632) at org.jboss.netty.handler.codec.oneone.OneToOneEncoder.handleDownstream(OneToOneEncoder.java:70) at org.jboss.netty.channel.Channels.write(Channels.java:632) at org.jboss.netty.handler.codec.oneone.OneToOneEncoder.handleDownstream(OneToOneEncoder.java:70) at org.jboss.netty.channel.Channels.write(Channels.java:632) at org.jboss.netty.handler.codec.oneone.OneToOneEncoder.handleDownstream(OneToOneEncoder.java:70) at com.linkedin.norbert.network.netty.ServerFilterChannelHandler.handleDownstream(ServerChannelHandler.scala:86) at org.jboss.netty.channel.Channels.write(Channels.java:611) at org.jboss.netty.channel.Channels.write(Channels.java:578) at org.jboss.netty.channel.AbstractChannel.write(AbstractChannel.java:259) at com.linkedin.norbert.network.netty.ServerChannelHandler.responseHandler(ServerChannelHandler.scala:163) at com.linkedin.norbert.network.netty.ServerChannelHandler$$anonfun$messageReceived$1.apply(ServerChannelHandler.scala:138) at com.linkedin.norbert.network.netty.ServerChannelHandler$$anonfun$messageReceived$1.apply(ServerChannelHandler.scala:137) at com.linkedin.norbert.network.server.ThreadPoolMessageExecutor$RequestRunner$$anonfun$run$3.apply(MessageExecutorComponent.scala:152) at com.linkedin.norbert.network.server.ThreadPoolMessageExecutor$RequestRunner$$anonfun$run$3.apply(MessageExecutorComponent.scala:151) at scala.Option.foreach(Option.scala:185) at com.linkedin.norbert.network.server.ThreadPoolMessageExecutor$RequestRunner.run(MessageExecutorComponent.scala:151) at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1110) at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:603) at java.lang.Thread.run(Thread.java:722)

    JIRA | 4 years ago | Ron Siemens
    java.nio.channels.ClosedChannelException
  3. Speed up your debug routine!

    Automated exception search integrated into your IDE

  4. 0

    Activator Connection lost

    GitHub | 2 years ago | butscharoni
    java.nio.channels.ClosedChannelException
  5. 0

    Activator fails

    GitHub | 2 years ago | jim-collins
    java.nio.channels.ClosedChannelException

  1. Piz 8 times, last 4 months ago
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 org.jboss.netty.channel.socket.nio.NioWorker.cleanUpWriteBuffer()
  2. Netty
    OneToOneEncoder.handleDownstream
    1. org.jboss.netty.channel.socket.nio.NioWorker.cleanUpWriteBuffer(NioWorker.java:637)
    2. org.jboss.netty.channel.socket.nio.NioWorker.writeFromUserCode(NioWorker.java:370)
    3. org.jboss.netty.channel.socket.nio.NioServerSocketPipelineSink.handleAcceptedSocket(NioServerSocketPipelineSink.java:137)
    4. org.jboss.netty.channel.socket.nio.NioServerSocketPipelineSink.eventSunk(NioServerSocketPipelineSink.java:76)
    5. org.jboss.netty.channel.Channels.write(Channels.java:632)
    6. org.jboss.netty.handler.codec.oneone.OneToOneEncoder.handleDownstream(OneToOneEncoder.java:70)
    7. org.jboss.netty.channel.Channels.write(Channels.java:632)
    8. org.jboss.netty.handler.codec.oneone.OneToOneEncoder.handleDownstream(OneToOneEncoder.java:70)
    9. org.jboss.netty.channel.Channels.write(Channels.java:632)
    10. org.jboss.netty.handler.codec.oneone.OneToOneEncoder.handleDownstream(OneToOneEncoder.java:70)
    10 frames
  3. com.linkedin.norbert
    ServerFilterChannelHandler.handleDownstream
    1. com.linkedin.norbert.network.netty.ServerFilterChannelHandler.handleDownstream(ServerChannelHandler.scala:86)
    1 frame
  4. Netty
    AbstractChannel.write
    1. org.jboss.netty.channel.Channels.write(Channels.java:611)
    2. org.jboss.netty.channel.Channels.write(Channels.java:578)
    3. org.jboss.netty.channel.AbstractChannel.write(AbstractChannel.java:259)
    3 frames
  5. com.linkedin.norbert
    ThreadPoolMessageExecutor$RequestRunner$$anonfun$run$3.apply
    1. com.linkedin.norbert.network.netty.ServerChannelHandler.responseHandler(ServerChannelHandler.scala:163)
    2. com.linkedin.norbert.network.netty.ServerChannelHandler$$anonfun$messageReceived$1.apply(ServerChannelHandler.scala:138)
    3. com.linkedin.norbert.network.netty.ServerChannelHandler$$anonfun$messageReceived$1.apply(ServerChannelHandler.scala:137)
    4. com.linkedin.norbert.network.server.ThreadPoolMessageExecutor$RequestRunner$$anonfun$run$3.apply(MessageExecutorComponent.scala:152)
    5. com.linkedin.norbert.network.server.ThreadPoolMessageExecutor$RequestRunner$$anonfun$run$3.apply(MessageExecutorComponent.scala:151)
    5 frames
  6. Scala
    Option.foreach
    1. scala.Option.foreach(Option.scala:185)
    1 frame
  7. com.linkedin.norbert
    ThreadPoolMessageExecutor$RequestRunner.run
    1. com.linkedin.norbert.network.server.ThreadPoolMessageExecutor$RequestRunner.run(MessageExecutorComponent.scala:151)
    1 frame
  8. Java RT
    Thread.run
    1. java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1110)
    2. java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:603)
    3. java.lang.Thread.run(Thread.java:722)
    3 frames