commons-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From bugzi...@apache.org
Subject DO NOT REPLY [Bug 36117] New: - Local File.exists() doesn't return recent results.
Date Wed, 10 Aug 2005 11:03:51 GMT
DO NOT REPLY TO THIS EMAIL, BUT PLEASE POST YOUR BUG·
RELATED COMMENTS THROUGH THE WEB INTERFACE AVAILABLE AT
<http://issues.apache.org/bugzilla/show_bug.cgi?id=36117>.
ANY REPLY MADE TO THIS MESSAGE WILL NOT BE COLLECTED AND·
INSERTED IN THE BUG DATABASE.

http://issues.apache.org/bugzilla/show_bug.cgi?id=36117

           Summary: Local File.exists() doesn't return recent results.
           Product: Commons
           Version: Nightly Builds
          Platform: Other
        OS/Version: Windows XP
            Status: NEW
          Severity: normal
          Priority: P2
         Component: VFS
        AssignedTo: commons-dev@jakarta.apache.org
        ReportedBy: rimovm@centercomp.com


When a FileObject is first created, it attaches to the file and sets the
Imaginary bit as appropriate.  The problem is that this doesn't allow for
underlying changes (deletions) in the file.

Concrete Example:

(1) Thread 1 Creates a temp java.io.File and then a FileObject and passes the
FileObject to Thread 2
(2) Thread 2 checks for exists().  true
(3) Thread 1 Deletes underlying File (via java.io.File.delete()).
(4) Thread 2 checks for exists().... still true.

I don't believe this is a classical race condition as so much as it is caching
too much information.

The above use case is useful for "watchdog" situations when you want to watch a
file and be notified of removal of the object.

Thanks!
-Mike

-- 
Configure bugmail: http://issues.apache.org/bugzilla/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug, or are watching the assignee.

---------------------------------------------------------------------
To unsubscribe, e-mail: commons-dev-unsubscribe@jakarta.apache.org
For additional commands, e-mail: commons-dev-help@jakarta.apache.org


Mime
View raw message