Name: gm110360 Date: 02/25/2004
FULL PRODUCT VERSION :
java version "1.4.2_03"
Java(TM) 2 Runtime Environment, Standard Edition (build 1.4.2_03-b02)
Java HotSpot(TM) Client VM (build 1.4.2_03-b02, mixed mode)
FULL OS VERSION :
Linux 2.4.18-3 #1
A DESCRIPTION OF THE PROBLEM :
When operating on NFS-mounted volumes, java.io.File.exists will sometimes return "false" even though the file referenced actually does exist.
The actual problem is a stale NFS file handle, which can occur for a number of reasons.
An examination of the java source code shows that File.exists ends up performing a stat(2). If the stat fails, then File.exists assumes that the file being stat'ed does not exist. This is a false assumption. stat(2) can fail for several reasons other than ENOENT. One such "other" error is ESTALE, which is what I get if I use JNI to perform a "native" stat(2) on the same file that File.exists claims does not exist.
STEPS TO FOLLOW TO REPRODUCE THE PROBLEM :
I do not have a simple method for reproducing this problem, however an examination of the java sources will bear out my explantion above.
EXPECTED VERSUS ACTUAL BEHAVIOR :
If the file exists, I expect java.io.File.exists to return "true"
java.io.File.exists returns "false" occasionally.
This bug can be reproduced occasionally.
(Incident Review ID: 191975)