talexb has asked for the wisdom of the Perl Monks concerning the following question:

I'm sporadically getting the following error when I run my web application:

I'm using Cache::SizeAwareFileCache to cache some data, and I think I'm running into some parallelization issues. I have a couple of processes running in parallel that try to cache objects with keys that may already exist. Sometimes I get the error shown above.

I'm not sure how to track this down, however, and was wondering if anyone here had any suggestions.

I'm using Log::Log4perl to do my logging .. not really sure that I want to add some logger statements inside any of the Cache modules to try and debug this.

Hmm .. maybe wrap the offending call in an eval and do a confess if a bad thing happened ..

Alex / talexb / Toronto

"Groklaw is the open-source mentality applied to legal research" ~ Linus Torvalds

  • Comment on Possible parallelization issues with Cache::SizeAwareFileCache

Replies are listed 'Best First'.
Re: Possible parallelization issues with Cache::SizeAwareFileCache
by talexb (Chancellor) on Oct 25, 2004 at 21:38 UTC
      Hmm .. maybe wrap the offending call in an eval and do a confess if a bad thing happened ..

    Interesting what happens when you follow your own advice.

    I wrapped the three possibly offending calls up with an eval and after trying to provoke the error finally got *two* errors:

    • Inappropriate ioctl for device
    • Stale NFS file handle
    with the first error causing the second error. So that tells me that it's an NFS problem, which is fine. The parallel processes are jobs running on a Sun Grid Engine that are all using NFS to come back to my workstation's file system.

    That tells me that NFS may need tuning, but it's not the fault of the Cache::Cache family of modules or even my web application.

    So, problem solved. Thanks anyway!

    Alex / talexb / Toronto

    "Groklaw is the open-source mentality applied to legal research" ~ Linus Torvalds

Re: Possible parallelization issues with Cache::SizeAwareFileCache
by fglock (Vicar) on Oct 25, 2004 at 21:25 UTC

    Did you try upgrading Cache::Cache?
    The current code in CPAN seems to be protected against this error - it always returns an array reference (I hope I looked at the correct line).