lkml.org 
[lkml]   [1999]   [Mar]   [26]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
SubjectRe: Socket termination problem
From
Date
laurila@bore.fysik.lu.se (Henrik Laurila) writes:

> I have experienced problems with terminations of TCP-sockets.
>
> 1) My side is actively sending a large amount of data to a rather
> slow peer.
>
> 2) The peer suddenly dies.
>
> 3) The socket-state becomes CLOSE_WAIT, and will stay so until the
> sending process is killed.

This is correct. CLOSE_WAIT means it waits for a close() from the
application, and a kill closes all open file descriptors.
Fix: call close() at the right time in your app.

>
> 4) If the sending process is killed, the socket-state will turn into
> LAST_ACK, and will stay so "forever".
>
> 5) This "forever", might sometimes only last for a few weeks or months.

This should not happen. What does netstat -t --timers output for such a
socket?

LAST-ACK means that it is waiting for the ack of the FIN just send.
If it does not appear the socket should be destroyed via a timer
after some time. When the other end retransmits packets (e.g. its FIN)
it is possible that the timer is always restarted. So what OS is the
peer running?

Is there any activity still on the connection (check with tcpdump) ?

-Andi

--
This is like TV. I don't like TV.

-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.rutgers.edu
Please read the FAQ at http://www.tux.org/lkml/

\
 
 \ /
  Last update: 2005-03-22 13:51    [W:0.051 / U:1.268 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site