Beefy Boxes and Bandwidth Generously Provided by pair Networks
P is for Practical
 
PerlMonks  

Re^4: Testing for readdir failure

by Bob Cook (Acolyte)
on Apr 23, 2013 at 02:45 UTC ( [id://1030027]=note: print w/replies, xml ) Need Help??


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

> 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.

Replies are listed 'Best First'.
Re^5: Testing for readdir failure
by LanX (Saint) on Apr 23, 2013 at 15:18 UTC
    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
Domain Nodelet?
Node Status?
node history
Node Type: note [id://1030027]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others scrutinizing the Monastery: (6)
As of 2024-04-20 02:30 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found