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

Hi,

Please notice the IO operations are not written directly to the disk, but to various levels of cache. With respect of the amount of directories processed, the origin of the issue might not even be in PERL but in the operating system and the way the disk snapshot are refreshed. This would explain the mixed result. I experienced this kind of problems on MS system.

K

The best medicine against depression is a cold beer!

Replies are listed 'Best First'.
Re^3: Testing for readdir failure
by LanX (Saint) on Apr 24, 2013 at 10:39 UTC
    Sure, but IMHO a cache should be transparent.

    Cheers Rolf

    ( addicted to the Perl Programming Language)

      Definitely! My issue looked very similar and was the result of a bug in the "fsflush" process (name of the process in Solaris). This process flushes all buffers to the disk. It is also responsible to provide a consistent snapshot of the disk + buffers state via an API to the other components of a system.

      I currently have a similar issue on a Linux box. The mixed hard disk snapshot is not always consistent. Sometimes the buffers are not properly flushed to the hard disk and I loose the solid state part of the storage. This matter has the same behavior as this case: no error at all at any level.

      So provided you have a unix box try the following:

      # Prior to any opendir() statement issue: system("sync"); # This will flush all buffers to the disk and refresh the disk snapsho +t # Next issue your opendir statement opendir(...); # Start your processing

      If your issue disappears it is most probably an OS problem and PERL can not really help but you have a solution.

      K

      The best medicine against depression is a cold beer!

        This is a very interesting suggestion. And, the program IS running on Linux machines. Do you know if there are analogous problems in the case of reads (you talked about problems with writing, which I am not doing)? And, is there any code for suppressing that condition analogous to your "sync" command for writes?

        Of course, though this might illuminate my current problem, it does not solve the more general question: How does a Perl program discover that readdir could not execute correctly due to, for example, a hardware disk error?