- Community Home
- >
- Servers and Operating Systems
- >
- Operating Systems
- >
- Operating System - HP-UX
- >
- NFS stale file descriptor and close ()
Categories
Company
Local Language
Forums
Discussions
Forums
- Data Protection and Retention
- Entry Storage Systems
- Legacy
- Midrange and Enterprise Storage
- Storage Networking
- HPE Nimble Storage
Discussions
Forums
Discussions
Discussions
Discussions
Forums
Forums
Discussions
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
- BladeSystem Infrastructure and Application Solutions
- Appliance Servers
- Alpha Servers
- BackOffice Products
- Internet Products
- HPE 9000 and HPE e3000 Servers
- Networking
- Netservers
- Secure OS Software for Linux
- Server Management (Insight Manager 7)
- Windows Server 2003
- Operating System - Tru64 Unix
- ProLiant Deployment and Provisioning
- Linux-Based Community / Regional
- Microsoft System Center Integration
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Community
Resources
Forums
Blogs
- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО11-16-2005 02:14 PM
тАО11-16-2005 02:14 PM
NFS stale file descriptor and close ()
Quick question(s).
When NFS returns a stale file descriptor error during a call to close(), does it still release the file descriptor back to the OS? Or will it only release the file descriptor when the close actually succeeds? (Running HPUX 11v2 Sept 04)
We have a system in which hard mount points may occasionally lose connection to the NFS server whether or not all files have been closed. The application using these open files may call close() on the files after the connection is lost and the stale file handle error is returned. Eventually, when the mount point becomes available again, the application will reopen files on this mount point. I'd like to prevent any file descriptor leaks if possible. Can I assume that even if close returns with an error that the file descriptor is closed?
Is there a utility under HPUX that one can use to see the active file descriptors? If so, I should be able to find out if NFS closes the file descriptor or not in this case.
Thanks in advance for the help!
Bryan
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО11-16-2005 02:44 PM
тАО11-16-2005 02:44 PM
Re: NFS stale file descriptor and close ()
I point this out only to tell you that the system must handle this as a more or less routine event whether the files are local or not --- after all, that aspect of the file is invisinle to the application. In any event, from the perspective of the process there is nothing that you could do about it after the file descriptor is no longer valid.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО11-16-2005 02:59 PM
тАО11-16-2005 02:59 PM
Re: NFS stale file descriptor and close ()
Its possible the file handle has been left open on the NFS server. It depends on whether the termination was abnormal or not.
I've recently fixed some issues with mysql server that stores its data on NFS, which is not a fully supported scenario, but that is where the disk space is.
The mysqld server crashes for unknown reason and won't start up again when the box comes back because as far as the nfs server goes the file was not closed properly.
In my case I had to re-run exportfs and restart the NFS service on the server which runs Linux. I'm not sure which action fixed the problem but now my mysql start script does both just to insure it comes up at boot time.
So its possible the file handle is still open and action will be required on the NFS server to fix it.
SEP
Owner of ISN Corporation
http://isnamerica.com
http://hpuxconsulting.com
Sponsor: http://hpux.ws
Twitter: http://twitter.com/hpuxlinux
Founder http://newdatacloud.com
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО11-16-2005 03:18 PM
тАО11-16-2005 03:18 PM
Re: NFS stale file descriptor and close ()
I'm thinking we may run into the same case you are having with your mysql server over NFS if the server thinks the file is still open.
I wonder if a CIFS/Samba server would do the same?
Bryan
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО11-17-2005 01:29 AM
тАО11-17-2005 01:29 AM
Re: NFS stale file descriptor and close ()
Thanks again for the great input.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО11-17-2005 08:57 PM
тАО11-17-2005 08:57 PM
Re: NFS stale file descriptor and close ()
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО11-27-2005 04:12 PM
тАО11-27-2005 04:12 PM
Re: NFS stale file descriptor and close ()
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО12-22-2005 08:22 PM
тАО12-22-2005 08:22 PM
Re: NFS stale file descriptor and close ()
Brian
How did it go with your NFS and lsof,
was the advice it worth a few points ?
Thx
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО12-23-2005 05:10 AM
тАО12-23-2005 05:10 AM
Re: NFS stale file descriptor and close ()
I'm not sure if you're checking this thread any more, but I wanted to reply anyway in case others happen across this thread.
One point I'd like to make is that the NFS server does not really "open" files or keep file handles opened while clients are accessing them. The NFS server code runs in the kernel and uses device/block interfaces to directly access either the raw blocks on disk or any pages in cache. It doesn't keep references to these files "open" in the traditional sense.
If there is a file descriptor leak involved with NFS it would have to be on the client. If there is a file descriptor leak occurring on an NFS server then it would be caused by an application running on the NFS server, not the nfsd/nfsktcpd daemons/threads themselves.
As for your original query about stale file descriptors, are you talking about getting an actual ESTALE error or are you talking about a "stale" mount point where the server is unavailable? I'm trying to understand if you think you're getting an ESTALE error when you shouldn't be. However, if you're just talking about a hung filesystem caused by a down server then that's fine.
Regards,
Dave
I work at HPE
HPE Support Center offers support for your HPE services and products when and how you need it. Get started with HPE Support Center today.
[Any personal opinions expressed are mine, and not official statements on behalf of Hewlett Packard Enterprise]

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО12-26-2005 03:53 PM
тАО12-26-2005 03:53 PM
Re: NFS stale file descriptor and close ()
Dave,
Thanks for the background on the NFS file server-side. It was actually a directory timing out; not an ESTALE.
Thanks again for the help from everyone.