[Catalyst] Catalyst::Engine file handle exhaustion with C::P::JSONRPC

Tatsuhiko Miyagawa miyagawa at gmail.com
Mon Nov 5 17:29:25 GMT 2007


Hi,

On 11/5/07, James R. Leu <jleu at mindspring.com> wrote:
> If the file handle exhaustion I'll mention below
> is due to something that C::P::JSONRPC is doing wrong, I'll accept that
> and just use the 'hack' I have in place.

If Catalyst::Engine doesn't cleanup the body of the request, it
doesn't really sound like C::P::JSONRPC to me.

> I've traced the origins of the files back to Catalyst::Engine
> (more specifically HTTP::Body's use of File::Temp).  If I add the following
> 'hack' to the end of Catalyst::Engine::finalize_body the files in /tmp
> get closed and I no longer experience the file handle exhaustion:
>
>    if (defined($c->request->{_body})) {
>        delete $c->request->{_body};
>    }
>
> So I have a couple of questions:
> - is there a better way to 'fix' this?
> - has anyone else seen this?
> - what else am I breaking by adding this 'hack'?

I'm also curious to these. If there's a better way to fix this inside
C::P::JSONRPC, I'd love to apply the patch.

> - any prediction as to if this behavior will be the same running under
>  mod_perl or FCGI?

Do you experience the same issue with the sandalone server or
mod_perl? If not, it definitely sounds like Catalyst::Engine's FCGI
bug.


-- 
Tatsuhiko Miyagawa



More information about the Catalyst mailing list