FIN_WAIT_2 happens when the local end of a socket is closed and the operating system is waiting for a signal that the remote end has closed their side. In your case, enough connections haven't that the operating system's socket table has filled, and new sockets can't be allocated.
I have a possible solution, but I don't have anything to test it against. If you could provide a test case that reliably triggers the problem, I can debug it quickly and turn around a better answer.
Meanwhile I have taken a guess at a solution, but you'll have to test it for me. If you can, please edit Client/Keepalive.pm (not Connection/Keepalive.pm). There should be a comment around line 582:
# Build a connection object around the socket.
I need you to add these three lines before that comment (wherever it may be):
When it comes time to close that socket, it should not linger in FIN_WAIT_2.use Socket qw(SOL_SOCKET SO_LINGER); setsockopt($socket, SOL_SOCKET, SO_LINGER, pack("sll",1,0,0)) or die +( "setsockopt: $!" + );
If that works for you, keep it free of charge. Also, let me know so I can include it in a future release.
Thank you.
In reply to Re: POE::Component::Client::HTTP, Keepalive, FIN_WAIT_2
by rcaputo
in thread POE::Component::Client::HTTP, Keepalive, FIN_WAIT_2
by nuclon
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |