[interchange-cvs] interchange - heins modified lib/Vend/Server.pm

interchange-cvs at icdevgroup.org interchange-cvs at icdevgroup.org
Mon Jul 12 01:02:51 EDT 2004


User:      heins
Date:      2004-07-12 05:02:50 GMT
Modified:  lib/Vend Server.pm
Log:
* Discovered reason we had so many "page server NNNNN would not die"
  errors in prefork mode. We weren't removing dead page servers from
  the %Page_pids hash, so we were trying to terminate/kill non-existent
  servers.

* When we say kill, mean it. We were not actually doing a KILL; whether
  we should is questionable, I guess; but all servers should accept a
  TERM unless totally hung.

Revision  Changes    Path
2.56      +6 -5      interchange/lib/Vend/Server.pm


rev 2.56, prev_rev 2.55
Index: Server.pm
===================================================================
RCS file: /var/cvs/interchange/lib/Vend/Server.pm,v
retrieving revision 2.55
retrieving revision 2.56
diff -u -r2.55 -r2.56
--- Server.pm	27 Jun 2004 19:02:27 -0000	2.55
+++ Server.pm	12 Jul 2004 05:02:50 -0000	2.56
@@ -1,6 +1,6 @@
 # Vend::Server - Listen for Interchange CGI requests as a background server
 #
-# $Id: Server.pm,v 2.55 2004/06/27 19:02:27 mheins Exp $
+# $Id: Server.pm,v 2.56 2004/07/12 05:02:50 mheins Exp $
 #
 # Copyright (C) 2002-2003 Interchange Development Group
 # Copyright (C) 1996-2002 Red Hat, Inc.
@@ -26,7 +26,7 @@
 package Vend::Server;
 
 use vars qw($VERSION);
-$VERSION = substr(q$Revision: 2.55 $, 10);
+$VERSION = substr(q$Revision: 2.56 $, 10);
 
 use POSIX qw(setsid strftime);
 use Vend::Util;
@@ -1031,8 +1031,9 @@
 
 			foreach my $pid (@pids) {
 				kill(0, $pid) and next;
-#::logDebug("Unresponsive server at PID %s", $pid);
+#::logDebug("Non-existent server at PID %s", $pid);
 				push @bad_pids, $pid;
+				delete $Page_pids{$pid};
 			}
 
 			while($count < $Global::StartServers) {
@@ -1042,17 +1043,17 @@
 			}
 			for my $pid (@bad_pids) {
 #::logDebug("Killing excess or unresponsive server at PID %s", $pid);
+				next unless delete $Page_pids{$pid};
 				if(kill 'TERM', $pid) {
 #::logDebug("Server at PID %s terminated OK", $pid);
 					# This is OK
 				}
-				elsif (kill 'TERM', $pid) {
+				elsif (kill 'KILL', $pid) {
 					::logGlobal("page server pid %s required KILL", $pid);
 				}
 				else {
 					::logGlobal("page server pid %s won't die!", $pid);
 				}
-				delete $Page_pids{$pid};
 			}
 		}
 








More information about the interchange-cvs mailing list