Bug 16718 - Possibility for a corrupt feature on install
Summary: Possibility for a corrupt feature on install
Status: RESOLVED FIXED
Alias: None
Product: Platform
Classification: Eclipse Project
Component: Update (deprecated - use Eclipse>Equinox>p2) (show other bugs)
Version: 2.0   Edit
Hardware: PC Windows 2000
: P1 critical (vote)
Target Milestone: 2.0 F2   Edit
Assignee: Christophe Elek CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2002-05-22 02:42 EDT by Vlad Klicnik CLA
Modified: 2002-05-29 07:41 EDT (History)
0 users

See Also:


Attachments
Dialog if an 'imposter feature' is installed [GIF] (7.54 KB, image/gif)
2002-05-24 12:47 EDT, Christophe Elek CLA
no flags Details

Note You need to log in before you can comment on or make changes to this bug.
Description Vlad Klicnik CLA 2002-05-22 02:42:52 EDT
I have not actually observed the corruption, but an deducing this from the 
function behavior.

We currently download and install the feature files even if they already exist. 
The download part I am OK with, but the install is a potential timebomb. I have 
noticed that when we install nested features, the feature files for feature 1 
are installed before we start downloading files for feature 2. If the user 
cancels the operation, feature 1 is left in the feature9999999.xml state. If 
this was a feature that already existed prior to the install, we just blew it 
away.


Som we can download feature jar for features that are already installe (no 
harm) but we MUST NOT actually overwrite files for an existing feature (ie. we 
skip the install copy step for the feature files and only install diffed 
plugins)
Comment 1 Christophe Elek CLA 2002-05-24 08:12:21 EDT
We need to NOT install feature files if the feature already exists (what about
checking, do we check the file system for the directory or the plugin version,
b/c we can have a plugin org.plugin1 in com.company.plugin23_2.0.0 right)

Then we have to check the abort and remove doesn't remove the feature files
Comment 2 Vlad Klicnik CLA 2002-05-24 09:31:22 EDT
* if feature with same id & version is already on site, skip file copy
* if not, check if <id>_<version>/feature.xml exists
* if not .... go ahead and copy
* if yes, we have an "imposter" feature living in the target directory .... 
CoreException
Comment 3 Christophe Elek CLA 2002-05-24 12:29:57 EDT
Feature.install() checks if a feature with the same id_ver has been installed in
the site.
UpdateManagerUtils.copyToLocal throws an IO Exception if the to create already
exists on the file system.
Comment 4 Christophe Elek CLA 2002-05-24 12:47:42 EDT
Created attachment 1041 [details]
Dialog if an 'imposter feature' is installed [GIF]
Comment 5 Christophe Elek CLA 2002-05-24 13:13:46 EDT
SiteFileContentConsumer and SiteFilePluginContentConsumer now remember which
file they installed. During an abort only these files will be deleted. Issue,
the directories will stay
Comment 6 Christophe Elek CLA 2002-05-24 14:35:19 EDT
Empty directories are removed. Fixed. Version as v20020524_16718
Comment 7 Christophe Elek CLA 2002-05-29 07:41:18 EDT
Fixed, 0528