TCP connection not timing out, visible on server but not client

1

On the server both the application and netstat show a connection open. The client however lists no such connection, and the client software is definitely stopped.

I'd already lowered the TCP keepalive settings:

cat /proc/sys/net/ipv4/tcp_keepalive_time
60
cat /proc/sys/net/ipv4/tcp_keepalive_intvl
10
cat /proc/sys/net/ipv4/tcp_keepalive_probes
3

What's causing these connections to remain, even though the client has most definitely disconnected?

Max

Posted 2012-08-15T19:12:57.380

Reputation: 637

What's under the State heading in netstat? – Alan Curry – 2012-08-15T19:28:11.813

@AlanCurry ESTABLISHED – Max – 2012-08-15T19:31:36.443

1Can you do a packet capture? You'll see the traffic and responses and be able to tell which side is having the issue. – MaQleod – 2012-08-15T19:40:35.433

How did you stop the client software? I hope it wasn't a kill -9 .... – ott-- – 2012-08-15T19:44:06.380

FIN should be sent by the server even after kill -9. Possibly there is another process on the client that inherited the socket fd and hasn't died yet? – Alan Curry – 2012-08-15T19:47:25.590

@MaQleod It's definitely not the client, I just restarted it and netstat on the server still reports an ESTABLISHED connection – Max – 2012-08-15T20:12:35.770

@AlanCurry Definitely not another process, just restarted the client machine, and netstat on the server still reports it – Max – 2012-08-15T20:14:11.127

Then you probably just don't have keepalive enabled on the socket. the /proc/sys/... keepalive values are just fine tuning. You can't globally force all TCP sockets on the system to use keepalive, if that's what you're thinking. – Alan Curry – 2012-08-15T20:25:43.497

Just because you see ESTABLISHED doesn't mean that it isn't the client. Until you see the details in the packets between the two parties, you have no clue what is actually going on. – MaQleod – 2012-08-16T05:53:54.553

@MaQleod I meant that I rebooted the client machine, and yet the server was still reporting connections. So it's definitely not the client. – Max – 2012-08-16T12:51:26.617

No answers