I have an API where requests can include JSON.  HTTP::Body saves those off
to temp files.

Yesterday got a very large number of errors:

[ERROR] "Caught exception in engine "Error in tempfile() using
/tmp/XXXXXXXXXX: Have exceeded the maximum number of attempts (1000) to
open temp file/dir

The File::Temp docs say:

If you are forking many processes in parallel that are all creating
> temporary files, you may need to reset the random number seed using
> srand(EXPR) in each child else all the children will attempt to walk
> through the same set of random file names and may well cause
> themselves to give up if they exceed the number of retry attempts.


We are running under mod_perl.   Could it be as simple as the procs all
were in sync?   I'm just surprised this has not happened before.   Is there
another explanation?

Where would you suggest to call srand()?


Another problem, and one I've
commented<https://rt.cpan.org/Public/Bug/Display.html?id=84004>on
before, is that HTTP::Body doesn't use File::Temp's unlink feature and
depends on Catalyst cleaning up.  This results in orphaned files left on
temp disk.





-- 
Bill Moseley
mose...@hank.org
_______________________________________________
List: Catalyst@lists.scsys.co.uk
Listinfo: http://lists.scsys.co.uk/cgi-bin/mailman/listinfo/catalyst
Searchable archive: http://www.mail-archive.com/catalyst@lists.scsys.co.uk/
Dev site: http://dev.catalyst.perl.org/

Reply via email to