Operating System - HP-UX
1844431 Members
3297 Online
110233 Solutions
New Discussion

'Interesting' NFS problem

 
Gary Cooper_1
Esteemed Contributor

'Interesting' NFS problem

I've got a really 'interesting' NFS problem that I've found a work-around for, but the workaround is rather a bit of a bodge.

HostA is my NFS server. Host B is my NFS client.
HostA runs program ProgA which creates a file, FileA on a local disk.
It then calls "remsh HostB ProgB". ProgB then tries to open FileA across the NFS link.
This results in the following error message (on HostA):
Error: Cannot open file FileA - Stale NFS file handle (error=70)

Now, if I put a 25 second delay between the file being created and the remsh command, ProgB successfully opens FileA and all is well. If I reduce the delay to 20 seconds, I still get the same stale file handle error. This isn't really a viable work-around.

The work-around/bodge is to put the following command before the remsh in ProgA:
remsh HostB ls -l FileA.
This generates the error:
FileA not found
But progB then runs successfully.

If anyone can explain what's happening here, I'd be grateful.
If anyone can propose a 'proper' solution, I'd be even more grateful.

Thanks,

Gary
2 REPLIES 2
A. Clay Stephenson
Acclaimed Contributor

Re: 'Interesting' NFS problem

Almost certainly, NFS is working as designed. You are the "victim" of attribute caching. Essentially there is a tradeoff of performance vs. latency and for you latency is more important. The good bews is that you can control this. Do a man mount_nfs and pay attention to the sections describing the noac, nocto, acdirmax, acdirmin, acregmax, acregmin, and actimeo mount options.
If it ain't broke, I can fix that.
Gary Cooper_1
Esteemed Contributor

Re: 'Interesting' NFS problem

Thanks for the pointer Clay.
The week-end begins in 7 minutes, so I'll follow this up on Monday.

Cheers,

Gary