We run a service with lots of embedded devices in the field, their tcp stack is a bit buggy and sometimes does not close connections properly, resulting in some connections being stuck in FIN-WAIT-2 on the server.
Normally, these connections would timeout according to
/proc/sys/net/ipv4/tcp_fin_timeout, but our connections are still visible far after a minute in
ss. Even restarting the process does not get rid of them, the only way seems to be a reboot.
The long term solution is, of course, to fix the clients to close the connection properly, but it concerns me that the connections are not timing out, even though they should be. What could cause this? How can I get rid of the useless connections?