Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.

Bug 429921

Summary: consistency issues with extracting bundle content to cache
Product: [Eclipse Project] Equinox Reporter: Thomas Watson <tjwatson>
Component: FrameworkAssignee: Thomas Watson <tjwatson>
Status: RESOLVED FIXED QA Contact:
Severity: normal    
Priority: P3    
Version: 3.10.0 Luna   
Target Milestone: Luna M7   
Hardware: PC   
OS: Mac OS X   
Whiteboard:

Description Thomas Watson CLA 2014-03-07 17:16:29 EST
For jar'ed bundles the framework has to extract content to disk for a number of reasons.  For example, for loading native code and using inner jars for a bundle class path.

There is a window where multiple processes could attempt to extract the content to the same file location.  This likely would result in some IOException (which ultimately gets lost) and then resulting in a zero length file.  This only would happen if multiple processes are attempting to use the same framework storage area and at least two processes are attempting to access extracted content for at exactly the same time and attempting to extract it.

One possible fix to consider is to use a staging file to write the content and only when the content has been successfully written do we move it to the final destination.
Comment 1 Thomas Watson CLA 2014-03-10 10:13:43 EDT
There were several calls to mkdirs() that did not account for multiple threads/processes attempting to call mkdirs() at the same time and one returning false even though the directory got created by another process.  If fixed that with commit::

http://git.eclipse.org/c/equinox/rt.equinox.framework.git/commit/?id=180bc899f1560e348940b0e981ba115a5904da7c

Fixed consistency issues with:

http://git.eclipse.org/c/equinox/rt.equinox.framework.git/commit/?id=fd27fc11ad0ef046510ef4ec4a20fb3638d243ce