Pathologically Eclectic Rubbish Lister | |
PerlMonks |
[solved] plack: close filehandle responsibilityby basiliscos (Pilgrim) |
on May 05, 2015 at 17:21 UTC ( [id://1125754]=perlquestion: print w/replies, xml ) | Need Help?? |
basiliscos has asked for the wisdom of the Perl Monks concerning the following question: Solved! The root reason was in wrong DB-access: I use 'moo' to and always re-use the cached DB-connection, instead of creating new one on demand. (And "indirectly" closing it after serving the request). I actually used SQLite, so after heavy usage of it, it internally used filehandles and didn't closed them, so I got my error after some time. Thanks all for answers. The correct answer to my initial question is: indeed, I'm responsible for closing filehandle, but Path::Tiny does the right thing (DWIM) it closes the filehandle when it is no longer used; hence, my code sample provided here is valid. Hello dear monks! I'm using Kelp, which is very Plack-centered framework. I have the following code for rendering icons:
After some time of execution under plackup I got the following error: Error open (<:raw) on \'storage/3/icon-256.ico\': Too many open files at ... Why so? I looked at Kelp::Request sources, and it just transfers the filehandle for Plack. Why Plack does not closes it after rendering the requests? Yes, I know that I could do something like:
but this is counter-effective a little bit? sendfile(2) cannot be used by server, and why at all I should load the whole image into perl, while actually i don't need it?
WBR, basiliscos.
Back to
Seekers of Perl Wisdom
|
|