Community
Participate
Working Groups
Created attachment 129245 [details] Local update site I've had frequent problems with invalid errors in provisioning plans. To help debug, I decided to make a local update site with features that I knew were correct. I have WTP installed, and moved a feature from my WTP install to another folder and created an update site around it (zipped and attached to this bug). Using the following code to get a provisioning plan for the feature in this local update site hangs for 163 seconds on my machine. One core of my dual-core CPU is spiked at 100% for most of the time. BundleContext bundleContext = Activator.getDefault().getBundle().getBundleContext(); IPlanner planner = (IPlanner) ExtensionUtility.getService(bundleContext, IPlanner.class.getName()); IProfileRegistry profileRegistry = (IProfileRegistry) ExtensionUtility.getService(bundleContext, IProfileRegistry.class.getName()); IProfile profile = profileRegistry.getProfile(IProfileRegistry.SELF); ProfileChangeRequest pcr = new ProfileChangeRequest(profile); pcr.addInstallableUnits(new IInstallableUnit[] { iu } ); provContext = new ProvisioningContext(); plan = planner.getProvisioningPlan(pcr, provContext, monitor);
Was the result of the planning successfull or not? What was the value of ProvisioningPlan.getStatus()? If it is an error(which I would expect) this is a dupe of 266687. In any event we will need the following information - Machine description (OS / proc /memory) - VM - The last profile file (eclipse/p2/org.eclipse.equinox.p2.engine/profileRegistry/<profile>/<mostRecent>.profile - What you are trying to install (the name of the IU) and from which repository
Created attachment 129255 [details] p2 profile Yes, it does result in an error. The error is incorrect (investigating to open another bug), and I can attach the text if you want. - Machine description (OS / proc /memory) T60p, 1.86Ghz dual core, 2Gb memory - VM IBM JDK 1.6 - The last profile file (eclipse/p2/org.eclipse.equinox.p2.engine/profileRegistry/<profile>/<mostRecent>.profile Attached. - What you are trying to install (the name of the IU) and from which repository Update site is attached, I was installing the IU that represents the single feature in it.
To ensure that other sites aren't contacted during the planning, you might want to change provContext = new ProvisioningContext(); to provContext = new ProvisioningContext(new URI [] {myLocalSiteURI}); If there are no other sites defined with the repo manager it wouldn't make a difference, but if there are remote sites involved, that could certainly slow down the planning if the remote sites have not been loaded yet. (In particular if an old UM site is being found for the first time, metadata would be generated, etc.)
Did you had metadata generated for this site when you were trying the installation?
Tim, If your cpu load is 100% on one core, it is likely that it is spent on SAT solving. You mention that the error in the installation is incorrect. Could you give us more details? (error message and why it is incorrect)
>I have WTP installed, and moved a feature from my WTP install to >another folder and created an update site around it (zipped and attached to >this bug). I suspect this is the root of the problem, but can you explain how you did this? Did you just move the feature/plugins out of the eclipse/features and eclipse/plugins directories by hand, or did you uninstall the feature from your profile? Moving files around by hand that have been provisioned by p2 isn't supported. p2 will believe those feature/plugins are still installed because the profile, bundles.info, etc, will still contain references to those features and plugins.
Replying to comment #4, there is no update site metadata pre-generated in this case, since external adopters do not typically have any. In response to comment #3, making the change to only use the URI of the repository I'm installing from fixes the performance issue! It's down to 3s, which is still isn't great for adding a small IU with no dependencies to a small install :), but much better than 163s. I removed the URI again to prove this was indeed the cause, and could reproduce. It looks like it took about 10s downloading content.jar file(s) from eclipse.org, and then went into endless SAT solving. I had to kill it after 10 minutes of CPU time. Mis-read the CPU graph before - both CPUs were hot at ~60% for this entire time since download. Opened bug 269288 for the plan errors. For comment #6, I moved & modified the features before this unzip install was started the first time. Since WTP build does not generate p2 metadata and p2 took the usual long delay to start the first time, I am assuming I correctly did it before p2 generated metadata for the install. If there's somewhere I can look at to verify this or you'd like me to re-install, I can try that too.
The computation of explanation can be removed by setting the property org.eclipse.equinox.p2.director.explain to false on the provisioningcontext passed to when calling getProvisioningPlan
It is now possible to cancel explanation computation. It might be a good idea to notify quickly the error to the user and to display an information message such as: "Your request cannot be fulfilled. Producing an explanation may take a while. Hit cancel to got back to the selection panel".
This is what is already being done. However this would not help this particular case because I believe here Tim operates headlessly / through code. IMO In these cases it would actually probably be more pain for him to cancel on error, rather than just set the property.
Thanks for the tip on org.eclipse.equinox.p2.director.explain. I've verified it works in my case, and it usually takes only half the time of waiting for the full explanation of a failed plan (e.g. 5s vs 10s in one case). Unfortunately, I'm not sure how we could make use of this option. When a user goes to install an IU they'll want the full explanation (although knowing they can cancel via the monitor is goodness), but the performance is still too slow to use for other purposes (e.g. see bug 260319).
as mentinoed in bug 260319 having an option to do explanation would be great. Users/scenarios that want explanation can redo with the option turned on.
*** This bug has been marked as a duplicate of bug 266687 ***