Umm.. This sounds like "TCP_CLOSE_WAIT" as opposed to "TCP_CLOSE". And that
makes sense, because any socket in TCP_CLOSE shouldn't even show up on
netstat (because it simply isn't there any more). Maybe "netstat" has a
bug and reports the wrong state?
And "TCP_CLOSE_WAIT" should NOT time out. Because the state essentially
means that the other end has closed the connection, and the networking
side is now waiting for _our_ application to close down the socket. And
obviously the kernel can't time out on that.
So if you see sockets in CLOSE state (and assuming this really is
TCP_CLOSE_WAIT), it probably means that there is a local application that for
some unfathomable reason keeps the socket open. So rather than a kernel
problem, it might indicate a user-level problem (a application getting stuck
waiting for something to happen, possibly due to race conditions within the
application itself due to signal handling or something)?
Linus