Shutdown added content sockets to prevent hung connections.
authorJason Stephenson <jstephenson@mvlc.org>
Tue, 30 Apr 2013 17:23:24 +0000 (13:23 -0400)
committerMike Rylander <mrylander@gmail.com>
Wed, 1 May 2013 14:46:32 +0000 (10:46 -0400)
We were getting several thousand sockets hanging around in a
CLOSE_WAIT state on our server.  The connections were from our
server and to our server.  Further investigation showed it to be
caused by the stage2 added content lookup not closing the request
sockets when it was done reading data.  This branch fixes that.

Signed-off-by: Jason Stephenson <jstephenson@mvlc.org>
Signed-off-by: Mike Rylander <mrylander@gmail.com>
Open-ILS/src/perlmods/lib/OpenILS/WWW/EGCatLoader/Record.pm

index 6e89be3..f38c582 100644 (file)
@@ -535,6 +535,8 @@ sub added_content_stage2 {
                     }
                 }
             }
+            # To avoid a lot of hanging connections.
+            $req->shutdown(2);
         }
     }
 }