Subject: | Unexpected behavior when "dropped-in" to Catalyst |
I'm interested in writing a patch to add better process management for
FCGI processes and FCGI::Engine seemed much more sane to me than
C::E::FastCGI and FCGI::ProcManager.
However, when attempting to create a script to launch an existing
Catalyst app as FastCGI processes via FCGI::Engine I get the following
strange behavior (Apache 2.2 w/ mod_fastcgi talking to Catalyst via
console-launched external FastCGI socket):
1. Requests to Apache seem to connect and begin to get data but then
hang and Apache's memory usage skyrockets. Is there a bad loop somewhere
that's constantly writing to Apache? I can literally go back-and-forth
b/t my old C::E::FastCGI script and my new FCGI::Engine script and the
C::E::FastCGI version works fine.
2. The processes spawned via the FCGI::Engine script do not appear to
honor SIGNALs. Again I can go back-and-forth b/t my old C::E::FastCGI
script and the FCGI::Engine one and the latter does not respond to 'kill
-TERM' only 'kill -KILL', while the processes created via the old-style
script seem to work fine when sent a SIGTERM.
######### BEGIN FCGI::Engine based script
#!/usr/bin/perl
#BEGIN {
# $ENV{CATALYST_ENGINE} ||= 'CGI';
#}
use strict;
use warnings;
use FindBin;
use lib(
"$FindBin::Bin/../lib",
"$FindBin::Bin/../ext-lib",
);
use FCGI::Engine;
#use My::Cat::App;
FCGI::Engine->new_with_options(
handler_class => 'My::Cat::App',
handler_method => 'handle_request',
)->run;