in reply to Exhausting filehandles behaviour?

Without a relevant code example its hard to say what's going on. I would expect it to die if it exhausted the FDs available to the process. Looking at the latest source of File::Slurp, write_file() closes its filehandle in the normal course of events, and doesn't catch exceptions that would be thrown by resource exhaustion.

I wonder if there is an error in the httpd log.

Replies are listed 'Best First'.
Re^2: Exhausting filehandles behaviour?
by erroneousBollock (Curate) on Feb 15, 2006 at 04:06 UTC
    Firstly, erroneousBollock == bollock. Sorry for any confusion.

    Hmmmmm, well this is embarassing, it seems that my test case which was stalling (no errors in apache log, logfile showed progress up to ~2.5MB) is now not failing. :-/

    Here is the test-case anyway.
    use strict; use warnings; use CGI qw(:all); use File::Slurp qw(write_file); sub hook { my ($file, $buffer, $bytes, $data) = @_; write_file('/tmp/uplog', {append => 1}, "[$file][$bytes][$data]"); } my $q = CGI->new(\&hook, 'AppName'); my $f = $q->param('upload_file'); print header(), "Done.";
Re^2: Exhausting filehandles behaviour?
by erroneousBollock (Curate) on Feb 15, 2006 at 04:08 UTC
    So the normal behaviour would be to die, not block, as I thought.

    ~2.5MB / 4k blocks -> ~640 handles. Not that many I guess.