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

Bug 327099

Summary: No prompt after update
Product: [Eclipse Project] Equinox Reporter: DJ Houghton <dj.houghton>
Component: p2Assignee: DJ Houghton <dj.houghton>
Status: RESOLVED FIXED QA Contact:
Severity: major    
Priority: P3 CC: john.arthorne, susan, tjwatson
Version: 3.7   
Target Milestone: 3.7 M3   
Hardware: PC   
OS: Mac OS X - Carbon (unsup.)   
Whiteboard:
Attachments:
Description Flags
Fix v01 none

Description DJ Houghton CLA 2010-10-06 08:41:41 EDT
Tom and I both have had the same problem where we update the SDK (or install a new bundle group... for me it was PDT) and the install appears to complete but there is no indication and no prompt for restart.

On further investigation, this stack is in the log file.


java.io.IOException: The element type "repository" must be terminated by the matching end-tag "</repository>".
at org.eclipse.equinox.internal.p2.metadata.repository.MetadataRepositoryIO$Parser.parse(MetadataRepositoryIO.java:217)
at org.eclipse.equinox.internal.p2.metadata.repository.MetadataRepositoryIO.read(MetadataRepositoryIO.java:65)
at org.eclipse.equinox.internal.p2.metadata.repository.SimpleMetadataRepositoryFactory.load(SimpleMetadataRepositoryFactory.java:107)
at org.eclipse.equinox.internal.p2.metadata.repository.MetadataRepositoryManager.factoryLoad(MetadataRepositoryManager.java:57)
at org.eclipse.equinox.internal.p2.repository.helpers.AbstractRepositoryManager.loadRepository(AbstractRepositoryManager.java:745)
at org.eclipse.equinox.internal.p2.repository.helpers.AbstractRepositoryManager.loadRepository(AbstractRepositoryManager.java:650)
at org.eclipse.equinox.internal.p2.metadata.repository.MetadataRepositoryManager.loadRepository(MetadataRepositoryManager.java:96)
at org.eclipse.equinox.internal.p2.metadata.repository.MetadataRepositoryManager.loadRepository(MetadataRepositoryManager.java:92)
at org.eclipse.equinox.internal.p2.metadata.repository.CompositeMetadataRepository.addChild(CompositeMetadataRepository.java:153)
at org.eclipse.equinox.internal.p2.metadata.repository.CompositeMetadataRepository.<init>(CompositeMetadataRepository.java:106)
at org.eclipse.equinox.internal.p2.metadata.repository.CompositeMetadataRepositoryFactory.load(CompositeMetadataRepositoryFactory.java:122)
at org.eclipse.equinox.internal.p2.metadata.repository.MetadataRepositoryManager.factoryLoad(MetadataRepositoryManager.java:57)
at org.eclipse.equinox.internal.p2.repository.helpers.AbstractRepositoryManager.loadRepository(AbstractRepositoryManager.java:745)
at org.eclipse.equinox.internal.p2.repository.helpers.AbstractRepositoryManager.loadRepository(AbstractRepositoryManager.java:650)
at org.eclipse.equinox.internal.p2.metadata.repository.MetadataRepositoryManager.loadRepository(MetadataRepositoryManager.java:96)
at org.eclipse.equinox.internal.p2.metadata.repository.MetadataRepositoryManager.loadRepository(MetadataRepositoryManager.java:92)
at org.eclipse.equinox.p2.ui.LoadMetadataRepositoryJob.doLoad(LoadMetadataRepositoryJob.java:115)
at org.eclipse.equinox.p2.ui.LoadMetadataRepositoryJob.runModal(LoadMetadataRepositoryJob.java:100)
at org.eclipse.equinox.internal.p2.ui.sdk.PreloadingRepositoryHandler$2.runModal(PreloadingRepositoryHandler.java:82)
at org.eclipse.equinox.p2.operations.ProvisioningJob.run(ProvisioningJob.java:177)
at org.eclipse.core.internal.jobs.Worker.run(Worker.java:54)
Comment 1 DJ Houghton CLA 2010-10-06 13:39:24 EDT
The stack trace seems unrelated. We are trying to add a child to a composite repository and the child is malformed so we log an error and continue. 

I just upgraded from one build to another and didn't get a prompt. (or stack)
Comment 2 DJ Houghton CLA 2010-10-06 14:20:25 EDT
I'll take a look at this. We'll need to modify ProfileModificationJob to handle the case where a profileid of _SELF_ is handled correctly.
Comment 3 DJ Houghton CLA 2010-10-06 15:10:29 EDT
Susan, what are your thoughts here? Currently the method looks like this:
	public int getRestartPolicy() {
		IProfile profile = getSession().getProfileRegistry().getProfile(IProfileRegistry.SELF);
		String id = profile == null ? null : profile.getProfileId();
		if (id != null && profileId.equals(id))
			return restartPolicy;
		return ProvisioningJob.RESTART_NONE;
	}

And I'm wondering if it is enough to do this:
	public int getRestartPolicy() {
		if (profileId.equals(IProfileRegistry.SELF))
			return restartPolicy;
		return ProvisioningJob.RESTART_NONE;
	}

I guess the question is: Is there a case where the profileid of the job isn't _SELF_ and we are updating ourselves? Could it be the actual id of the profile?

With the registry lookup code, I'm slightly worried about the case where we are using a build (with a _SELF_  profile id of SDKProfile) to update a different install (with the same profile id). I believe in that case we would be prompted to restart because our profile ids matched.
Comment 4 John Arthorne CLA 2010-10-08 16:54:37 EDT
Created attachment 180520 [details]
Fix v01
Comment 5 John Arthorne CLA 2010-10-08 16:56:32 EDT
Susan, this is a fairly major bug so we are just going to release a fix for the next I-build. Would still appreciate a quick look at the patch when you get a chance, just to make sure we understood the intent of the change you made here.
Comment 6 DJ Houghton CLA 2010-10-08 17:07:25 EDT
With the patch I am now prompted between updates.
Patch released to HEAD.
Closing.