[FASTCGI] Fastcgi and perl : How to recover from an error?

Matt S Trout mst at shadowcat.co.uk
Thu Feb 11 16:45:42 EST 2010

On Wed, Feb 10, 2010 at 06:51:13PM -0500, Richard Dumoulin wrote:
> [Wed Feb 10 08:43:50 2010] [error] [client X.Y.Z.194] FastCGI: server
> "xxxxxxxx/index.fcgi" stderr: Can't use an undefined value as a HASH
> reference at xxxxxxxx/index.fcgi line 153., referer:
> http://xxxxxxxx/index.fcgi?demande=rech&str=rivi%E8re
> and it went like that for 30 minutes until Apache was restarted.
> Is there  a config to add in Apache to fix this?  I found the following in
> the doc : 
> -restart (none) 
> Causes the process manager to restart dynamic applications upon failure
> (similar to static applications). 

Right, so what happened is your app (on the other end of the socket) die()ed
at which point there was nothing for apache to talk to down the socket - and
since you didn't configure it to restart it that just threw errors.

I think you probably want to (a) turn that config option on (b) stick a
big eval {} around your top level run loop so an exception generated by
the request handling code in your app doesn't take out the FastCGI handler.

        Matt S Trout         Catalyst and DBIx::Class consultancy with a clue
     Technical Director      and a commit bit: http://shadowcat.co.uk/catalyst/
 Shadowcat Systems Limited
  mst (@) shadowcat.co.uk        http://shadowcat.co.uk/blog/matt-s-trout/

More information about the FastCGI-developers mailing list