Subject: | [PATCH] child processes do not exist in forked mode with write error |
When running in forked (-f) mode and a write error occurs, the child
process then starts listening for and serving requests. If there are
many write errors, multiple children and the parent all attempt to serve
requests and end up becoming memory hogs.
The patch is as follows:
==============
diff -ur Catalyst-Runtime-5.7007.orig/lib/Catalyst/Engine/HTTP.pm
Catalyst-Runtime-5.7007/lib/Catalyst/Engine/HTTP.pm
--- Catalyst-Runtime-5.7007.orig/lib/Catalyst/Engine/HTTP.pm
2007-03-13 13:17:56.000000000 +0000
+++ Catalyst-Runtime-5.7007/lib/Catalyst/Engine/HTTP.pm 2007-05-15
12:37:14.000000000 +0100
@@ -277,6 +277,10 @@
if ( my $error = delete $self->{_write_error} ) {
DEBUG && warn "Write error: $error\n";
close Remote;
+ if(defined $pid) {
+ $daemon->close;
+ exit;
+ }
next LISTEN;
}
==============