FIN_WAIT2 is hanging forever
In an SFTP communication, the status of the port is always hanging in FIN_WAIT2. My understanding about FIN_WAIT2 is that this socket is waiting on other side to send final FIN command which it is not sending due to some reason. Please correct me if my understanding is not correct ?
My question is, is there a way these FIN_WAIT2 can be removed, I believe that this can be controlled by setting timeout in /proc/sys/net/ipv4/tcp_fin_timeout, but there is a default time of 60 sec. in there but even after 60 sec. the sockets are in the same state of FIN_WAIT2. How can we get rid of this state. Please note that we do not want to manually killing the port or restarting the application.
Thanks in Advance.