in reply to Re: plack: close filehandle responsibility
in thread [solved] plack: close filehandle responsibility

Let me clarify the question: who is responsible for closing the filehandle? My code, framework (Kelp) or Plack?

Everybody is responsible :)

You assume the problem is with Kelp or Plack but you haven't ruled out your own code; you always have to rule out your own code first

If you can write a minimal Kelp app serving files that runs out of filehandles, only then can you assume there is a problem with Kelp or Plack, until then you should assume the problem is with your code

The problem is not with Kelp::Response::render_binary as it doesn't leave handles open.

It hands the handle to Plack::Response::body, and eventually sub response_cb in Plack::Util which reads from the handle and then closes the handle.

 

On a side note, if don't already know, you should ignore flushells the troll

  • Comment on Re^2: plack: close filehandle responsibility (everybody)