[ic] ChildLife config directive - page server pid xxxxx won't die

John Young john_young at sonic.net
Tue Jul 20 17:29:52 EDT 2004


John1 wrote:

> Also, as a separate question, should the second
> kill 'TERM', $pid
> 
> actually be:
> kill 'KILL', $pid

Mike added that functionality to the development (5.3+) branch
a few days ago.  Following that CVS message.

HTH,
John Young

---------------------------------------------------------------

Date: Mon, 12 Jul 2004 01:02:51 -0400
From: interchange-cvs at icdevgroup.org
Subject: [interchange-cvs] interchange - heins modified
	lib/Vend/Server.pm

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-users mailing list