question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

java.net.SocketException Connection reset

See original GitHub issue

“java.net.SocketException Connection reset” is not handlet correctly inside of netty.

Leading to thread crashes using [netty-4.1.72] (https://github.com/netty/netty/releases/tag/netty-4.1.72.Final)

java.net.SocketException: Connection reset
        at java.base/sun.nio.ch.SocketChannelImpl.throwConnectionReset(SocketChannelImpl.java:394)
        at java.base/sun.nio.ch.SocketChannelImpl.read(SocketChannelImpl.java:426)
        at io.netty.buffer.PooledByteBuf.setBytes(PooledByteBuf.java:253)
        at io.netty.buffer.AbstractByteBuf.writeBytes(AbstractByteBuf.java:1132)
        at io.netty.channel.socket.nio.NioSocketChannel.doReadBytes(NioSocketChannel.java:350)
        at io.netty.channel.nio.AbstractNioByteChannel$NioByteUnsafe.read(AbstractNioByteChannel.java:151)
        at io.netty.channel.nio.NioEventLoop.processSelectedKey(NioEventLoop.java:722)
        at io.netty.channel.nio.NioEventLoop.processSelectedKeysOptimized(NioEventLoop.java:658)
        at io.netty.channel.nio.NioEventLoop.processSelectedKeys(NioEventLoop.java:584)
        at io.netty.channel.nio.NioEventLoop.run(NioEventLoop.java:496)
        at io.netty.util.concurrent.SingleThreadEventExecutor$4.run(SingleThreadEventExecutor.java:986)
        at io.netty.util.internal.ThreadExecutorMap$2.run(ThreadExecutorMap.java:74)

Issue Analytics

  • State:closed
  • Created 2 years ago
  • Comments:16 (7 by maintainers)

github_iconTop GitHub Comments

2reactions
Victorgreat4commented, Mar 31, 2022

Im having issues with the exact same problem on our tcp server, this connection reset problem: https://i.stack.imgur.com/vRlCH.png

It can happen at anytime and very hard to reproduce, sometimes during the serverhandler part and sometimes even before the initation of decoderheader and tcpserverhandler inside the TCPserver class that holds the runTCP. It started happening last week, never had any problems with this isse since 2021 - august, we have not changed the network code only data proccessing inside decoderheader. Have you any new information about this?

0reactions
chrisvestcommented, Jun 7, 2022

The netty-http thing is also logging it as it propagates through the pipeline: https://github.com/cdapio/netty-http/blob/b64b170a86d45bb6bed5ade5a4d59b4b8882f0d9/src/main/java/io/cdap/http/internal/RequestRouter.java#L110-L140

So I suspect no threads are actually crashing, and it’s just messages being logged from places that don’t show up in the stack trace.

I think we can close this.

Read more comments on GitHub >

github_iconTop Results From Across the Web

java.net.SocketException: Connection reset - Stack Overflow
Connection reset simply means that a TCP RST was received. This happens when your peer receives data that it can' ...
Read more >
How to resolve java.net.SocketException: Connection reset
This SocketException occurs on the server side when the client closed the socket connection before the response could be returned over the socket....
Read more >
How to Fix with java.net.SocketException: Connection reset ...
The java.net.SocketException: Connection reset error usually comes when one of the parties in TCP connection like client or server is trying to read/write...
Read more >
How To Fix Internet Exception java.net.socketexception ... - Alphr
1. Click the “Start” menu and search the "Control Panel." 2. Locate and click “Network and Sharing Center.” 3. Press “Network connection” and...
Read more >
How does java net SocketException Connection reset happen
The java.net.SocketException: Connection reset error usually comes when one of the parties in TCP connection like client or server is trying to ...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found