Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.
Bug 360414 - [Planner] After uninstall of bundles they are still listed in bundles.info
Summary: [Planner] After uninstall of bundles they are still listed in bundles.info
Status: CLOSED WONTFIX
Alias: None
Product: Equinox
Classification: Eclipse Project
Component: p2 (show other bugs)
Version: 3.7   Edit
Hardware: All All
: P3 normal with 2 votes (vote)
Target Milestone: ---   Edit
Assignee: P2 Inbox CLA
QA Contact:
URL:
Whiteboard: stalebug
Keywords:
Depends on:
Blocks:
 
Reported: 2011-10-10 05:46 EDT by Beyhan Veliev CLA
Modified: 2019-09-02 13:04 EDT (History)
2 users (show)

See Also:


Attachments
Test case to reproduce this bug (14.11 KB, application/zip)
2011-10-10 05:47 EDT, Beyhan Veliev CLA
no flags Details
Test case for this bug updated (14.45 KB, application/zip)
2011-10-17 14:46 EDT, Beyhan Veliev CLA
no flags Details
Prevents removal of profile properties (1.69 KB, patch)
2011-10-17 14:55 EDT, Beyhan Veliev CLA
no flags Details | Diff
test case update (14.30 KB, application/x-zip-compressed)
2011-11-07 12:44 EST, Beyhan Veliev CLA
no flags Details
Another optin to patch this bug (98.35 KB, text/plain)
2011-11-07 12:46 EST, Beyhan Veliev CLA
no flags Details

Note You need to log in before you can comment on or make changes to this bug.
Description Beyhan Veliev CLA 2011-10-10 05:46:29 EDT
The behavior of p2 planner in the following use case does not seem to be correct. Use case:
1) use the planner to create a profile change request which contains feature A for install and provision this change request
2) create and provision a profile change request where the installed version of feature A is added for install and for uninstall.
3) uninstall feature A.

The result of these tree operation is:
* feature A is uninstalled.
* all bundles which feature A includes are removed from the p2 profile but they are still listed in the bundles.info.

What happens is that during the operation 2) the inclusion rules of feature A are removed from the p2 profile which has the side effect that all bundles installed with feature A are still listed in the bundles.info after feature A is uninstalled. 

IMHO planner should be able to deal with this use case and it is a valid use of planner's APIs. Workaround is of course to filter all IUs which don't need to be uninstalled but why I need the planner then. I will attach a test case to this bug which reproduces this bug.
Comment 1 Beyhan Veliev CLA 2011-10-10 05:47:20 EDT
Created attachment 204862 [details]
Test case to reproduce this bug
Comment 2 Katya Stoycheva CLA 2011-10-13 15:32:12 EDT
Pascal, thank you for pointing to this fix (http://git.eclipse.org/c/equinox/rt.equinox.p2.git/commit/?id=37df25467c3b5a333c6c7993836723da05d9e8e1). It's indeed related to current issue though it seems it's not enough to fix it - the IUs are handled properly but there is a problem with the properties of those IUs which are both added and removed.

I guess what's done for IUs here:

SimplePlanner#computeActualChangeRequest(Collection<IInstallableUnit> toState, ProfileChangeRequest changeRequest) { Collection<IInstallableUnit> requestedAdditions = changeRequest.getAdditions;
Collection<IInstallableUnit> requestedRemovals = new ArrayList<IInstallableUnit>(changeRequest.getRemovals());
requestedRemovals.removeAll(requestedAdditions);

should be done for the properties here:
SimplePlanner#planPropertyOperations - remove all allIUPropertyChanges that exist in allIUPropertyDeletions

I'm not very familiar with how properties should be handled so could you please take a look at it and tell me what you think?
Comment 3 Beyhan Veliev CLA 2011-10-17 14:46:29 EDT
Created attachment 205363 [details]
Test case for this bug updated
Comment 4 Beyhan Veliev CLA 2011-10-17 14:55:15 EDT
Created attachment 205366 [details]
Prevents removal of profile properties

This patch just prevents the removal of profile properties for IUs which exists as additions and removals in a profile change request.
Comment 5 Beyhan Veliev CLA 2011-11-07 12:44:00 EST
Created attachment 206538 [details]
test case update
Comment 6 Beyhan Veliev CLA 2011-11-07 12:46:14 EST
Created attachment 206539 [details]
Another optin to patch this bug

Ian and I created a second option to fix this bug. This is a more general way to fix it and requires a little bit more changes.
Comment 7 Ian Bull CLA 2011-11-07 15:55:30 EST
Thanks Beyhan,

I thought a bit more about this on my way home -- and also talked with Pascal on the Equinox/p2 call.  While this does make the code a little nicer (one fix instead of two), it mutates the PCR, and this might have unwanted side effects.  I'll see if I can improve this a bit tomorrow.
Comment 8 Eclipse Genie CLA 2019-09-02 13:04:47 EDT
This bug hasn't had any activity in quite some time. Maybe the problem got resolved, was a duplicate of something else, or became less pressing for some reason - or maybe it's still relevant but just hasn't been looked at yet.

If you have further information on the current state of the bug, please add it. The information can be, for example, that the problem still occurs, that you still want the feature, that more information is needed, or that the bug is (for whatever reason) no longer relevant.

--
The automated Eclipse Genie.