Troubleshooting
Problem
A receive() issued from a client application, which was communicating with a server using loopback (127.0.0.1) or fast local sockets (local addresses for both end points) fails with ECONNRESET. The connection has been established between the two endpoints for 10-11 minutes and neither side has issued a close(), however, the server side of the connection was in close wait state prior to the ECONNRESET failure.
Cause
Immediately after successfully connecting to the server and sending data, the client application issued a shutdown() for write. This causes the client to stop sending data, but allows it to continue to receive from the server peer. This shutdown() causes the client side of the TCP loopback connection to transition to FINWAIT2 state and the server side of the connection to transition to CLOSWAIT. After the shutdown(), the server continued to send data to the client, while the client continued to read. However, after 10 - 11 minutes the default FINWAIT2 (TCPCONFIG FINWAIT2TIME) timer expired and deletes the FINWAIT2 client connection from the TCP hash table as expected. This causes a subsequent send() issued by the server to fail with errno EPIPE and a subsequent recv() issued by the client to fail with errno ECONNRESET.
Resolving The Problem
Either increase the FINWAIT2TINE to the max of 3600 seconds or if the connection will be actively sending data from the server for more then 3600 seconds, change the client application to issue the shutdown() at the point where connection can be closed.
Historical Number
18048;756;000
Was this topic helpful?
Document Information
Modified date:
15 June 2018
UID
swg21902342