Bug 17021

Summary: Install/ delete (cleanup after [Cancel]) order
Product: [Eclipse Project] Platform Reporter: Vlad Klicnik <klicnik>
Component: Update (deprecated - use Eclipse>Equinox>p2)Assignee: Christophe Elek <celek>
Status: RESOLVED FIXED QA Contact:
Severity: normal    
Priority: P1    
Version: 2.0   
Target Milestone: 2.0 F2   
Hardware: PC   
OS: Windows 2000   
Whiteboard:
Bug Depends on: 17756    
Bug Blocks:    

Description Vlad Klicnik CLA 2002-05-22 15:46:35 EDT
DESIGN CHANGE: from go/nogo discussions

When installing/ cleaning up, we currently take care to process the features 
and plugins in an order that never results in broken reference structures (eg. 
features referencing missing included features or missing plugins. The original 
thought was not to create broken structures. The downside of this approach is 
that we may end up with unmanaged plugins being included at runtime, and 
inadvertently be executing by the time we want to redo the failed install, for 
example. This would likely cause the install to fail (eg. open plugin .jar).

The alternative strategy is to reverse the processing order. This would 
potentially leave broken features, but we would never end up with unmanaged 
plugins. The broken features could then be fixed by re-installing/ updating 
them.

To do this, install would need to do the pass-2 rename top-down (pass-1 can 
stay as is). 

Cleanup (after failure, [Cancel]) would need to be deleting bottom-up (bu NEVER 
anything we did not actually install in the failed opreation). Need to discuss 
this one to make sure we are in synch.

Also, when poofing up the models, we'd need to tolerate missing includes the 
way we tolerate missing plugins (ie. results in parent not being happy)
Comment 1 Vlad Klicnik CLA 2002-05-24 10:54:07 EDT
When deleting, we must first delete the feature.xml/ plugin.xml/ fragment.xml 
file BEFORE we attempt to delete the corresponding directories.

boolean delete;
if (xmlFile.exists()) {
   delete = xmlFile.delete();
} else {
   delete = true;
}

if (delete) {
   // delete the dir
}

We should try to delete as much as we can (ie. log ioexceptions and continue).

Need to verify that when we reverse the install/ delete strategy, that we can 
in fact come up without problems with features that are missing plugins, or 
nested features that are missing children.
Comment 2 Christophe Elek CLA 2002-05-25 15:17:29 EDT
Changed the way install closes.
FeatureExecutableContentConsumer now doesn't close the
SitePluginEntryContentConsumer but calls SiteFileContentConsumer.close()
Which
1) renames feature.xml
2) close SitePluginEntryContentConsumer
3) returns a FeatureReference

FeatureExecutableContentConsumer  now closes the SiteFileContentConsumer, then
closes teh children features tehn returns the featureReference from the root
SiteFileContentConsumer.

The log shows:
install buttom up, rename top down

LogEntry.0=START_INSTALL_LOG
LogEntry.1=PLUGIN
c:\oti\source-code\plugins\my.alphabet.round.letters_1.0.1\plugin1022354695014.xml
LogEntry.2=PLUGIN
c:\oti\source-code\plugins\my.alphabet.letter.b_1.0.1\plugin1022354695054.xml
LogEntry.3=PLUGIN
c:\oti\source-code\plugins\my.alphabet.letter.c_1.0.1\plugin1022354695114.xml
LogEntry.4=FEATURE
c:\oti\source-code\features\my.alphabet.round.letters_1.0.1\feature1022354695575.xml
LogEntry.5=PLUGIN
c:\oti\source-code\plugins\my.alphabet.straight.letters_1.0.1\plugin1022354696476.xml
LogEntry.6=PLUGIN
c:\oti\source-code\plugins\my.alphabet.letter.a_1.0.1\plugin1022354696516.xml
LogEntry.7=PLUGIN
c:\oti\source-code\plugins\my.alphabet.letter.e_1.0.1\plugin1022354696566.xml
LogEntry.8=FEATURE
c:\oti\source-code\features\my.alphabet.straight.letters_1.0.1\feature1022354696677.xml
LogEntry.9=PLUGIN
c:\oti\source-code\plugins\my.alphabet_1.0.1\plugin1022354696947.xml
LogEntry.10=FEATURE
c:\oti\source-code\features\my.alphabet_1.0.1\feature1022354697137.xml
LogEntry.11=ALL_FEATURES_INSTALLED
LogEntry.12=RENAME
c:\oti\source-code\features\my.alphabet_1.0.1\feature1022354697137.xml
LogEntry.13=RENAME
c:\oti\source-code\plugins\my.alphabet_1.0.1\plugin1022354696947.xml
LogEntry.14=RENAME
c:\oti\source-code\features\my.alphabet.round.letters_1.0.1\feature1022354695575.xml
LogEntry.15=RENAME
c:\oti\source-code\plugins\my.alphabet.round.letters_1.0.1\plugin1022354695014.xml
LogEntry.16=RENAME
c:\oti\source-code\plugins\my.alphabet.letter.b_1.0.1\plugin1022354695054.xml
LogEntry.17=RENAME
c:\oti\source-code\plugins\my.alphabet.letter.c_1.0.1\plugin1022354695114.xml
LogEntry.18=RENAME
c:\oti\source-code\features\my.alphabet.straight.letters_1.0.1\feature1022354696677.xml
LogEntry.19=RENAME
c:\oti\source-code\plugins\my.alphabet.straight.letters_1.0.1\plugin1022354696476.xml
LogEntry.20=RENAME
c:\oti\source-code\plugins\my.alphabet.letter.a_1.0.1\plugin1022354696516.xml
LogEntry.21=RENAME
c:\oti\source-code\plugins\my.alphabet.letter.e_1.0.1\plugin1022354696566.xml
LogEntry.22=END_INSTALL_LOG
eof=eof

Comment 3 Christophe Elek CLA 2002-05-25 16:51:21 EDT
SitePluginEntryContentConsumer.abort 
SiteFileContentConsumer.abort now delete the 'oldPath' (i.e before rename so
feature.xml, plugin.xml or fragment.xml) before deleting the file it installed
(even overrided file will be deleted) and deleting empty directories.
The delete is buttom up

LogEntry.0=START_INSTALL_LOG
LogEntry.1=PLUGIN
c:\oti\source-code\plugins\my.alphabet.round.letters_1.0.0\plugin1022360385887.xml
LogEntry.2=PLUGIN
c:\oti\source-code\plugins\my.alphabet.letter.b_1.0.0\plugin1022360385927.xml
LogEntry.3=PLUGIN
c:\oti\source-code\plugins\my.alphabet.letter.c_1.0.0\plugin1022360385967.xml
LogEntry.4=FEATURE
c:\oti\source-code\features\my.alphabet.round.letters_1.0.0\feature1022360386017.xml
LogEntry.5=PLUGIN
c:\oti\source-code\plugins\my.alphabet.straight.letters_1.0.0\plugin1022360386879.xml
LogEntry.6=PLUGIN
c:\oti\source-code\plugins\my.alphabet.letter.a_1.0.0\plugin1022360386929.xml
LogEntry.7=DELETE
c:/oti/source-code/plugins/my.alphabet.straight.letters_1.0.0/plugin.xml
LogEntry.8=DELETE c:/oti/source-code/plugins/my.alphabet.letter.a_1.0.0/plugin.xml
LogEntry.9=DELETE
c:/oti/source-code/plugins/my.alphabet.round.letters_1.0.0/plugin.xml
LogEntry.10=DELETE c:/oti/source-code/plugins/my.alphabet.letter.b_1.0.0/plugin.xml
LogEntry.11=DELETE c:/oti/source-code/plugins/my.alphabet.letter.c_1.0.0/plugin.xml
LogEntry.12=DELETE
c:/oti/source-code/features/my.alphabet.round.letters_1.0.0/feature.xml


Will release in version v20020525_17021

Comment 4 Christophe Elek CLA 2002-05-29 07:59:59 EDT
Verified 0528