hi all...

I was thinking recently about how with 2.0 we rely on MaxClients to control the number of child processes, but with 1.3 we rely on httpd -X.

I'm not sure that we need to limit the ability of 1.3 to run multiple children if somebody comes up with a test that requires it. and we all know that httpd -X is not the same as running with a single child, so whatever the test suite is doing is not really the same as a real environment.

I'm thinking/hoping that -X is a carryover from the old Apache::test environment, and nobody actually relies on -X behaviors (which would be a bad testing practice anyway :)

at any rate, here is a patch that changes httpd -X to a setting that defaults to MaxClients 1. I get the same results from the perl-framework with and without the change (lots of failures currently, but they are the same failures with both setups).

as far as changed behaviors, the only thing I noticed was that if some perl libraries cannot be found, the startup times out and the @INC errors are placed in the error_log. without the patch the @INC error is shown and the server exits immediately. the good thing (for me, anyway) is that r->child_terminate now works, allowing the server to change children mid-test :)

--Geoff
Index: lib/Apache/TestConfig.pm
===================================================================
RCS file: 
/home/cvspublic/httpd-test/perl-framework/Apache-Test/lib/Apache/TestConfig.pm,v
retrieving revision 1.174
diff -u -r1.174 TestConfig.pm
--- lib/Apache/TestConfig.pm    22 Sep 2003 22:03:31 -0000      1.174
+++ lib/Apache/TestConfig.pm    26 Sep 2003 16:20:04 -0000
@@ -1711,6 +1711,12 @@
     MaxRequestsPerChild  0
 </IfModule>
 
+<IfDefine APACHE1>
+    StartServers         1
+    MaxClients           @MaxClients@
+    MaxRequestsPerChild  0
+</IfDefine>
+
 <IfModule mpm_winnt.c>
     ThreadsPerChild      20
     MaxRequestsPerChild  0
Index: lib/Apache/TestServer.pm
===================================================================
RCS file: 
/home/cvspublic/httpd-test/perl-framework/Apache-Test/lib/Apache/TestServer.pm,v
retrieving revision 1.65
diff -u -r1.65 TestServer.pm
--- lib/Apache/TestServer.pm    18 Sep 2003 07:39:35 -0000      1.65
+++ lib/Apache/TestServer.pm    26 Sep 2003 16:20:04 -0000
@@ -104,9 +104,8 @@
 sub start_cmd {
     my $self = shift;
     #XXX: threaded mpm does not respond to SIGTERM with -DONE_PROCESS
-    my $one = $self->{rev} == 1 ? '-X' : '';
     my $args = $self->args;
-    return "$self->{config}->{vars}->{httpd} $one $args";
+    return "$self->{config}->{vars}->{httpd} $args";
 }
 
 sub default_gdbinit {

Reply via email to