Beefy Boxes and Bandwidth Generously Provided by pair Networks
go ahead... be a heretic
 
PerlMonks  

Re^3: Testing for readdir failure

by LanX (Canon)
on Apr 23, 2013 at 00:52 UTC ( #1030006=note: print w/ replies, xml ) Need Help??


in reply to Re^2: Testing for readdir failure
in thread Testing for readdir failure

> it became clear that I missed making one point: When the readdir fails to deliver the entire contents of the directory, there is NO warning, nor any other message, issued by Perl.

It also became clear that you never clarified what exactly fails.

How do you expect us to reproduce and catch unidentified errors?

Are you even sure these are errors and not just race conditions because the content of a directory changed in the meantime?

Cheers Rolf

( addicted to the Perl Programming Language)


Comment on Re^3: Testing for readdir failure
Re^4: Testing for readdir failure
by Bob Cook (Acolyte) on Apr 23, 2013 at 02:45 UTC

    > It also became clear that you never clarified what exactly fails.

    The program runs weekly. Many weeks, it "fails" on a small percentage of directories. Those directories were last changed years ago. And yet, on this run, according to the results of readdir, there were some things missing that were present on previous runs, AND are present when I go to look at them after the failure. (And by the way, each week it fails on a different small subset of directories.)

    > How do you expect us to reproduce and catch unidentified errors?

    I don't know how to reproduce it. That's a real problem. I was looking for possible side effects from readdir that the program could check for. And some of the suggestions have been quite helpful, including yours.

    > Are you even sure these are errors and not just race conditions because the content of a directory changed in the meantime?

    I hope the first part of this text above answers this. Most of the directories haven't changed.

      Thanks "missing files" is an information.

      There are any possibilities, it could be your filesystem, it could be a perl bug, it could be a stupid race condition.

      For instance I had very confusing results in the tests of my first reply, deleting the opened directory before reading the files produced different results in consecutive runs... maybe I was to tired to nail down the problem.

      Anyway running your code now, with all messages (Fatals, Warnings and $!) catched and logged should hopefully give you a hint for suspicious signals.

      Cheers Rolf

      ( addicted to the Perl Programming Language)

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://1030006]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others wandering the Monastery: (6)
As of 2014-10-02 10:40 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    What is your favourite meta-syntactic variable name?














    Results (52 votes), past polls