CLOSE_WAIT issue (Software fails to close connections)

This is a discussion on CLOSE_WAIT issue (Software fails to close connections) within the Linux Networking forums, part of the Linux Forums category; I've got a server application which has a bad habit of failing to close socket connections after doing web ...


Go Back   Usenet Forums > Linux Forums > Linux Networking

FAQ Members List Calendar Search Today's Posts Mark Forums Read
  #1 (permalink)  
Old 03-20-2008
flarosa
 
Posts: n/a
Default CLOSE_WAIT issue (Software fails to close connections)

I've got a server application which has a bad habit of failing to
close socket connections after doing web services requests to other
servers. This leaves behind many sockets in the CLOSE_WAIT state.
Eventually (after 3-4 days) the number of sockets in this condition
becomes so large that it exceeds the maximum open files limit.

Unfortunately, the problem is in a third-party library which I cannot
immediately fix.

Is it possible to configure Linux to abandon CLOSE_WAIT sockets after
a timeout period? Is there a reason why the default behavior is no
timeout?

Frank
Reply With Quote
  #2 (permalink)  
Old 03-20-2008
Rick Jones
 
Posts: n/a
Default Re: CLOSE_WAIT issue (Software fails to close connections)

flarosa <frank@franklarosa.com> wrote:
> Unfortunately, the problem is in a third-party library which I
> cannot immediately fix.


> Is it possible to configure Linux to abandon CLOSE_WAIT sockets
> after a timeout period? Is there a reason why the default behavior
> is no timeout?


Because absent other information, it is impossible for TCP to tell the
difference between a simplex connection (send only relative to the
CLOSE_WAIT end) and an incomplete connection tear-down.

Anything in the stack that arbitrarily nuked such a connection from
the CLOSE_WAIT end is at best guessing.

Even TCP Keepalives cannot really deal with this since it is likely
there is still a TCP endpoint in FIN_WAIT_2 at the other end.

This will be an excellent test of the third party's responsiveness to
bugreports.

rick jones
--
The glass is neither half-empty nor half-full. The glass has a leak.
The real question is "Can it be patched?"
these opinions are mine, all mine; HP might not want them anyway... :)
feel free to post, OR email to rick.jones2 in hp.com but NOT BOTH...
Reply With Quote
Reply


Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are Off
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On



All times are GMT +1. The time now is 07:29 AM.


Powered by vBulletin® Version 3.6.8
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Content Relevant URLs by vBSEO 3.0.0