Server stops working after the exceptionCaught being called #5893

Closed
MagicDroidX opened this Issue Oct 5, 2016 · 10 comments

Projects

None yet

2 participants

@MagicDroidX
MagicDroidX commented Oct 5, 2016 edited
Network dropped connection on reset: no further information
at sun.nio.ch.DatagramChannelImpl.receive0(Native Method)
at sun.nio.ch.DatagramChannelImpl.receiveIntoNativeBuffer(Unknown Source)
at sun.nio.ch.DatagramChannelImpl.receive(Unknown Source)
at sun.nio.ch.DatagramChannelImpl.receive(Unknown Source)
at io.netty.channel.socket.nio.NioDatagramChannel.doReadMessages(NioDatagramChannel.java:240)
at io.netty.channel.nio.AbstractNioMessageChannel$NioMessageUnsafe.read(AbstractNioMessageChannel.java:75)
at io.netty.channel.nio.NioEventLoop.processSelectedKey(NioEventLoop.java:571)
at io.netty.channel.nio.NioEventLoop.processSelectedKeysOptimized(NioEventLoop.java:512)
at io.netty.channel.nio.NioEventLoop.processSelectedKeys(NioEventLoop.java:426)
at io.netty.channel.nio.NioEventLoop.run(NioEventLoop.java:398)
at io.netty.util.concurrent.SingleThreadEventExecutor$5.run(SingleThreadEventExecutor.java:877)
at io.netty.util.concurrent.DefaultThreadFactory$DefaultRunnableDecorator.run(DefaultThreadFactory.java:144)
at java.lang.Thread.run(Unknown Source)

Using netty 4.
Protocol: UDP
Override the exceptionCaught() to print the stack trace.
Since then the server stops working.
What should I do to recover the server?

@normanmaurer
Member

What version of Netty exactly? Also is this an IOException?

Am 05.10.2016 um 02:08 schrieb MagicDroidX notifications@github.com:

Network dropped connection on reset: no further information
at sun.nio.ch.DatagramChannelImpl.receive0(Native Method)
at sun.nio.ch.DatagramChannelImpl.receiveIntoNativeBuffer(Unknown Source)
at sun.nio.ch.DatagramChannelImpl.receive(Unknown Source)
at sun.nio.ch.DatagramChannelImpl.receive(Unknown Source)
at io.netty.channel.socket.nio.NioDatagramChannel.doReadMessages(NioDatagramChannel.java:240)
at io.netty.channel.nio.AbstractNioMessageChannel$NioMessageUnsafe.read(AbstractNioMessageChannel.java:75)
at io.netty.channel.nio.NioEventLoop.processSelectedKey(NioEventLoop.java:571)
at io.netty.channel.nio.NioEventLoop.processSelectedKeysOptimized(NioEventLoop.java:512)
at io.netty.channel.nio.NioEventLoop.processSelectedKeys(NioEventLoop.java:426)
at io.netty.channel.nio.NioEventLoop.run(NioEventLoop.java:398)
at io.netty.util.concurrent.SingleThreadEventExecutor$5.run(SingleThreadEventExecutor.java:877)
at io.netty.util.concurrent.DefaultThreadFactory$DefaultRunnableDecorator.run(DefaultThreadFactory.java:144)
at java.lang.Thread.run(Unknown Source)
Using netty 4.
Override the 'exceptionCaught()' to print the stack trace.
Since then the server stops working.
What should I do to recover the server?


You are receiving this because you are subscribed to this thread.
Reply to this email directly, view it on GitHub, or mute the thread.

@MagicDroidX

I am using Netty 4.1.4.Final and it is a java.net.SocketException

@normanmaurer
Member

@MagicDroidX are you sure you not call Channel.close() in some handler ?

@MagicDroidX
MagicDroidX commented Oct 5, 2016 edited

No i don't. And it happens randomly. But whenever the exception is thrown, the server will stop working.

@normanmaurer
Member

@MagicDroidX is it "just" an SocketException or a sub-type ?

@MagicDroidX

just a SocketException.

@normanmaurer
Member

@MagicDroidX ok thanks... let me look into it.

@normanmaurer normanmaurer self-assigned this Oct 5, 2016
@normanmaurer normanmaurer added this to the 4.0.42.Final milestone Oct 5, 2016
@normanmaurer normanmaurer added the defect label Oct 5, 2016
@normanmaurer normanmaurer added a commit that referenced this issue Oct 6, 2016
@normanmaurer normanmaurer [#5893] Ensure we not close NioDatagramChannel when SocketException i…
…s received.

Motivation:

When using java.nio.DatagramChannel we should not close the channel when a SocketException was thrown as we can still use the channel.

Modifications:

Not close the Channel when SocketChannel is thrown

Result:

More robust and correct handling of exceptions when using NioDatagramChannel.
b57a7c0
@normanmaurer
Member
@MagicDroidX

Okay thanks. :)

@normanmaurer normanmaurer added a commit that referenced this issue Oct 10, 2016
@normanmaurer normanmaurer [#5893] Ensure we not close NioDatagramChannel when SocketException i…
…s received.

Motivation:

When using java.nio.DatagramChannel we should not close the channel when a SocketException was thrown as we can still use the channel.

Modifications:

Not close the Channel when SocketException is thrown

Result:

More robust and correct handling of exceptions when using NioDatagramChannel.
672c86d
@normanmaurer normanmaurer added a commit that referenced this issue Oct 10, 2016
@normanmaurer normanmaurer [#5893] Ensure we not close NioDatagramChannel when SocketException i…
…s received.

Motivation:

When using java.nio.DatagramChannel we should not close the channel when a SocketException was thrown as we can still use the channel.

Modifications:

Not close the Channel when SocketException is thrown

Result:

More robust and correct handling of exceptions when using NioDatagramChannel.
e102a00
@normanmaurer normanmaurer added a commit that referenced this issue Oct 10, 2016
@normanmaurer normanmaurer [#5893] Ensure we not close NioDatagramChannel when SocketException i…
…s received.

Motivation:

When using java.nio.DatagramChannel we should not close the channel when a SocketException was thrown as we can still use the channel.

Modifications:

Not close the Channel when SocketException is thrown

Result:

More robust and correct handling of exceptions when using NioDatagramChannel.
71b8960
@normanmaurer
Member

Fixed by #5899

@MagicDroidX MagicDroidX added a commit to Nukkit/Nukkit that referenced this issue Oct 27, 2016
@MagicDroidX MagicDroidX Update netty to 4.1.6 due to netty/netty#5893 7cd0c8a
@boybook boybook added a commit to iTXTech/Nemisys that referenced this issue Nov 6, 2016
@boybook boybook Update netty to 4.1.6 due to netty/netty#5893, Fix VarInt. c0000f8
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment