Neti打开/关闭“zumbi”连接(频道)的问题

时间:2011-11-23 17:55:41

标签: java netty

我正在使用Netty 3.2.4并且我正在尝试调试我的应用程序以解决错误,但我意识到在我开始使用Netty运行我的应用程序之后,每2秒我就会得到一个打开/关闭连接(通道)来自“无处”。

我抛出一个新的Exception来获取堆栈跟踪以发现它来自何处,并且我看到一个“DeadLockProofWorker $ 1”类正在运行,根据以下堆栈跟踪。

它来自哪里?为什么?可以避免吗?

java.lang.Exception
    at org.spcbrasil.commbroker.server.handler.CleanUpServerHandler.channelClosed(CleanUpServerHandler.java:26)
    at org.jboss.netty.channel.SimpleChannelHandler.handleUpstream(SimpleChannelHandler.java:118)
    at org.jboss.netty.channel.DefaultChannelPipeline.sendUpstream(DefaultChannelPipeline.java:545)
    at org.jboss.netty.channel.DefaultChannelPipeline$DefaultChannelHandlerContext.sendUpstream(DefaultChannelPipeline.java:754)
    at org.jboss.netty.channel.SimpleChannelHandler.channelClosed(SimpleChannelHandler.java:228)
    at org.spcbrasil.commbroker.server.handler.CommBrokerServiceHandler.channelClosed(CommBrokerServiceHandler.java:79)
    at org.jboss.netty.channel.SimpleChannelHandler.handleUpstream(SimpleChannelHandler.java:118)
    at org.jboss.netty.channel.DefaultChannelPipeline.sendUpstream(DefaultChannelPipeline.java:545)
    at org.jboss.netty.channel.DefaultChannelPipeline$DefaultChannelHandlerContext.sendUpstream(DefaultChannelPipeline.java:754)
    at org.jboss.netty.channel.SimpleChannelHandler.channelClosed(SimpleChannelHandler.java:228)
    at org.spcbrasil.commbroker.server.handler.LogServerHandler.channelClosed(LogServerHandler.java:145)
    at org.jboss.netty.channel.SimpleChannelHandler.handleUpstream(SimpleChannelHandler.java:118)
    at org.jboss.netty.channel.DefaultChannelPipeline.sendUpstream(DefaultChannelPipeline.java:545)
    at org.jboss.netty.channel.DefaultChannelPipeline$DefaultChannelHandlerContext.sendUpstream(DefaultChannelPipeline.java:754)
    at org.jboss.netty.channel.SimpleChannelUpstreamHandler.channelClosed(SimpleChannelUpstreamHandler.java:208)
    at org.jboss.netty.channel.SimpleChannelUpstreamHandler.handleUpstream(SimpleChannelUpstreamHandler.java:98)
    at org.spcbrasil.commbroker.server.handler.HandshakeStopServerHandler.handleUpstream(HandshakeStopServerHandler.java:28)
    at org.jboss.netty.channel.DefaultChannelPipeline.sendUpstream(DefaultChannelPipeline.java:545)
    at org.jboss.netty.channel.DefaultChannelPipeline$DefaultChannelHandlerContext.sendUpstream(DefaultChannelPipeline.java:754)
    at org.jboss.netty.channel.SimpleChannelHandler.channelClosed(SimpleChannelHandler.java:228)
    at org.spcbrasil.commbroker.server.handler.HandshakeServerHandler.channelClosed(HandshakeServerHandler.java:107)
    at org.jboss.netty.channel.SimpleChannelHandler.handleUpstream(SimpleChannelHandler.java:118)
    at org.jboss.netty.channel.DefaultChannelPipeline.sendUpstream(DefaultChannelPipeline.java:545)
    at org.jboss.netty.channel.DefaultChannelPipeline$DefaultChannelHandlerContext.sendUpstream(DefaultChannelPipeline.java:754)
    at org.jboss.netty.handler.codec.oneone.OneToOneDecoder.handleUpstream(OneToOneDecoder.java:66)
    at org.jboss.netty.channel.DefaultChannelPipeline.sendUpstream(DefaultChannelPipeline.java:545)
    at org.jboss.netty.channel.DefaultChannelPipeline.sendUpstream(DefaultChannelPipeline.java:540)
    at org.jboss.netty.channel.Channels.fireChannelClosed(Channels.java:404)
    at org.jboss.netty.channel.socket.nio.NioWorker.close(NioWorker.java:593)
    at org.jboss.netty.channel.socket.nio.NioWorker.read(NioWorker.java:355)
    at org.jboss.netty.channel.socket.nio.NioWorker.processSelectedKeys(NioWorker.java:280)
    at org.jboss.netty.channel.socket.nio.NioWorker.run(NioWorker.java:200)
    at org.jboss.netty.util.ThreadRenamingRunnable.run(ThreadRenamingRunnable.java:108)
    at org.jboss.netty.util.internal.DeadLockProofWorker$1.run(DeadLockProofWorker.java:44)
    at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:886)
    at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:908)
    at java.lang.Thread.run(Thread.java:619)

1 个答案:

答案 0 :(得分:0)

从这看:

at org.jboss.netty.channel.socket.nio.NioWorker.close(NioWorker.java:593)
at org.jboss.netty.channel.socket.nio.NioWorker.read(NioWorker.java:355)

远程对等方关闭了连接。您的远程对等方是否使用半封闭连接? Netty不支持半封闭连接,因此如果远程对等端只关闭了连接的一半,则连接将被关闭。