http://www.perlmonks.org?node_id=1058173


in reply to -s test option returns differently in some cases

I wonder if you're suffering from NFS attribute caching?

My guess is that it could be reading the local stale cache and has just not seen the update yet. If you sleep for more than the attribute cache timeout (set in the NFS mount) it should correct itself. You could try a loop that sleeps for one second and then tests the file and see if it ever recognises the change.

Also, have you closed that file that you're writing to? I don't remember if this will flush the cache or not & I don't have a NFS server set up it test it on.

Have you checked that the nfs mount options are the same on both machines & that the defaults didn't change between versions?

You can set noac on the nfs mount but it does slow things down. Sadly, NFS is showing it's age and doesn't make a very good cluster file system.

  • Comment on Re: -s test option returns differently in some cases

Replies are listed 'Best First'.
Re^2: -s test option returns differently in some cases
by frogsausage (Sexton) on Oct 14, 2013 at 12:11 UTC

    Aaaaaaaaaand, it is a problem with the file not being closed. Something might have changed somewhere in Perl or SuSE in between these two version (of each).

    Thank you very much for helping me out here! I'm short of 'vote' but I will come back later!

Re^2: -s test option returns differently in some cases
by frogsausage (Sexton) on Oct 14, 2013 at 12:04 UTC

    Didn't think for a second about NFS actually. Lets see...

    My NFS has:

    acregmin=3,acregmax=60,acdirmin=30,acdirmax=60

    which are default values apparently. Therefore, I set a sleep to '3' and it didn't work "Failed". It is also much longer than the system() statement which works.

    Now, I've looked at how I am writing my file: open, print and then... nothing. I added a close statement and it works like a charm. Let me double check on that though, I might have forgotten a switch somewhere that could affect that. I'll report back soon!