Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.
Bug 348695 - [reconciler] p2 reconciler not multi-process safe
Summary: [reconciler] p2 reconciler not multi-process safe
Status: CLOSED WONTFIX
Alias: None
Product: Equinox
Classification: Eclipse Project
Component: p2 (show other bugs)
Version: 3.6.2   Edit
Hardware: PC Windows 7
: P3 normal (vote)
Target Milestone: ---   Edit
Assignee: P2 Inbox CLA
QA Contact:
URL:
Whiteboard: stalebug
Keywords:
Depends on:
Blocks:
 
Reported: 2011-06-08 05:52 EDT by Markus Keller CLA
Modified: 2020-03-06 17:17 EST (History)
5 users (show)

See Also:


Attachments
Logs (18.23 KB, text/plain)
2011-06-08 05:52 EDT, Markus Keller CLA
no flags Details

Note You need to log in before you can comment on or make changes to this bug.
Description Markus Keller CLA 2011-06-08 05:52:09 EDT
Created attachment 197576 [details]
Logs

I20110603-0909

I tried to launch 2 workspaces with the same Eclipse install at about the same time, and I got a few exceptions in the logs of both workspaces. I've launched the same install a few times before without making any changes to the installed plug-ins. The install is an eclipse-SDK-I20110603-0909-win32.zip + a few plug-ins linked in via eclipse/links/*.link .

Start of the exceptions, see attachment for the full logs of the 2 workspaces.

!ENTRY org.eclipse.equinox.p2.core 4 0 2011-06-08 11:29:36.673
!MESSAGE Provisioning exception
!STACK 1
org.eclipse.equinox.p2.core.ProvisionException: Repository already exists at file:/C:/e/i/I20110603-0909/configuration/org.eclipse.osgi/bundles/87/data/listener_1925729951/.
	at org.eclipse.equinox.internal.p2.repository.helpers.AbstractRepositoryManager.fail(AbstractRepositoryManager.java:393)
	at org.eclipse.equinox.internal.p2.repository.helpers.AbstractRepositoryManager.doCreateRepository(AbstractRepositoryManager.java:278)
	at org.eclipse.equinox.internal.p2.artifact.repository.ArtifactRepositoryManager.createRepository(ArtifactRepositoryManager.java:49)
	at org.eclipse.equinox.internal.provisional.p2.directorywatcher.RepositoryListener.initializeArtifactRepository(RepositoryListener.java:90)
	at org.eclipse.equinox.internal.provisional.p2.directorywatcher.RepositoryListener.<init>(RepositoryListener.java:60)
	at org.eclipse.equinox.internal.p2.reconciler.dropins.DropinsRepositoryListener.<init>(DropinsRepositoryListener.java:82)
	at org.eclipse.equinox.internal.p2.reconciler.dropins.Activator.watchDropins(Activator.java:532)
	at org.eclipse.equinox.internal.p2.reconciler.dropins.Activator.start(Activator.java:172)
	at org.eclipse.osgi.framework.internal.core.BundleContextImpl$1.run(BundleContextImpl.java:711)
	at java.security.AccessController.doPrivileged(Native Method)
	at org.eclipse.osgi.framework.internal.core.BundleContextImpl.startActivator(BundleContextImpl.java:702)
	at org.eclipse.osgi.framework.internal.core.BundleContextImpl.start(BundleContextImpl.java:683)
	at org.eclipse.osgi.framework.internal.core.BundleHost.startWorker(BundleHost.java:381)
	at org.eclipse.osgi.framework.internal.core.AbstractBundle.resume(AbstractBundle.java:389)
	at org.eclipse.osgi.framework.internal.core.Framework.resumeBundle(Framework.java:1130)
	at org.eclipse.osgi.framework.internal.core.StartLevelManager.resumeBundles(StartLevelManager.java:559)
	at org.eclipse.osgi.framework.internal.core.StartLevelManager.resumeBundles(StartLevelManager.java:544)
	at org.eclipse.osgi.framework.internal.core.StartLevelManager.incFWSL(StartLevelManager.java:457)
	at org.eclipse.osgi.framework.internal.core.StartLevelManager.doSetStartLevel(StartLevelManager.java:243)
	at org.eclipse.osgi.framework.internal.core.StartLevelManager.dispatchEvent(StartLevelManager.java:438)
	at org.eclipse.osgi.framework.internal.core.StartLevelManager.dispatchEvent(StartLevelManager.java:1)
	at org.eclipse.osgi.framework.eventmgr.EventManager.dispatchEvent(EventManager.java:230)
	at org.eclipse.osgi.framework.eventmgr.EventManager$EventThread.run(EventManager.java:340)
!SUBENTRY 1 org.eclipse.equinox.p2.artifact.repository 4 1001 2011-06-08 11:29:36.688
!MESSAGE Repository already exists at file:/C:/e/i/I20110603-0909/configuration/org.eclipse.osgi/bundles/87/data/listener_1925729951/.

!ENTRY org.eclipse.equinox.p2.reconciler.dropins 4 0 2011-06-08 11:29:36.704
!MESSAGE FrameworkEvent ERROR
!STACK 0
org.osgi.framework.BundleException: Exception in org.eclipse.equinox.internal.p2.reconciler.dropins.Activator.start() of bundle org.eclipse.equinox.p2.reconciler.dropins.
	at org.eclipse.osgi.framework.internal.core.BundleContextImpl.startActivator(BundleContextImpl.java:734)
	at org.eclipse.osgi.framework.internal.core.BundleContextImpl.start(BundleContextImpl.java:683)
	at org.eclipse.osgi.framework.internal.core.BundleHost.startWorker(BundleHost.java:381)
	at org.eclipse.osgi.framework.internal.core.AbstractBundle.resume(AbstractBundle.java:389)
	at org.eclipse.osgi.framework.internal.core.Framework.resumeBundle(Framework.java:1130)
	at org.eclipse.osgi.framework.internal.core.StartLevelManager.resumeBundles(StartLevelManager.java:559)
	at org.eclipse.osgi.framework.internal.core.StartLevelManager.resumeBundles(StartLevelManager.java:544)
	at org.eclipse.osgi.framework.internal.core.StartLevelManager.incFWSL(StartLevelManager.java:457)
	at org.eclipse.osgi.framework.internal.core.StartLevelManager.doSetStartLevel(StartLevelManager.java:243)
	at org.eclipse.osgi.framework.internal.core.StartLevelManager.dispatchEvent(StartLevelManager.java:438)
	at org.eclipse.osgi.framework.internal.core.StartLevelManager.dispatchEvent(StartLevelManager.java:1)
	at org.eclipse.osgi.framework.eventmgr.EventManager.dispatchEvent(EventManager.java:230)
	at org.eclipse.osgi.framework.eventmgr.EventManager$EventThread.run(EventManager.java:340)
Caused by: java.lang.IllegalStateException: Could not create artifact repository for: file:/C:/e/i/I20110603-0909/configuration/org.eclipse.osgi/bundles/87/data/listener_1925729951/
	at org.eclipse.equinox.internal.provisional.p2.directorywatcher.RepositoryListener.initializeArtifactRepository(RepositoryListener.java:94)
	at org.eclipse.equinox.internal.provisional.p2.directorywatcher.RepositoryListener.<init>(RepositoryListener.java:60)
	at org.eclipse.equinox.internal.p2.reconciler.dropins.DropinsRepositoryListener.<init>(DropinsRepositoryListener.java:82)
	at org.eclipse.equinox.internal.p2.reconciler.dropins.Activator.watchDropins(Activator.java:532)
	at org.eclipse.equinox.internal.p2.reconciler.dropins.Activator.start(Activator.java:172)
	at org.eclipse.osgi.framework.internal.core.BundleContextImpl$1.run(BundleContextImpl.java:711)
	at java.security.AccessController.doPrivileged(Native Method)
	at org.eclipse.osgi.framework.internal.core.BundleContextImpl.startActivator(BundleContextImpl.java:702)
	... 12 more
Comment 1 Dani Megert CLA 2011-06-14 06:06:31 EDT
Here's a similar exception caused by the same problem (I also started two workspaces at the same time). Just fails at a different location. I can confirm that this also happens in 3.6.2.

!SESSION 2011-06-14 09:57:36.910 -----------------------------------------------
eclipse.buildId=I20110613-1736
java.version=1.6.0_26-ea
java.vendor=Sun Microsystems Inc.
BootLoader constants: OS=win32, ARCH=x86, WS=win32, NL=de_CH
Framework arguments:  -keyring c:\eclipse\.keyring -application org.eclipse.ui.ide.workbench -showlocation
Command-line arguments:  -debug c:\eclipse\.options -keyring c:\eclipse\.keyring -application org.eclipse.ui.ide.workbench -showlocation -data c:\eclipse\workspaces\Development_HEAD\plugins

!ENTRY org.eclipse.osgi 4 0 2011-06-14 09:57:37.223
!MESSAGE The -clean (osgi.clean) option was not successful. Unable to clean the storage area: C:\eclipse\drops\I20110613-1736\configuration\org.eclipse.osgi

!ENTRY org.eclipse.equinox.p2.reconciler.dropins 4 0 2011-06-14 09:57:57.665
!MESSAGE FrameworkEvent ERROR
!STACK 0
org.osgi.framework.BundleException: Exception in org.eclipse.equinox.internal.p2.reconciler.dropins.Activator.start() of bundle org.eclipse.equinox.p2.reconciler.dropins.
	at org.eclipse.osgi.framework.internal.core.BundleContextImpl.startActivator(BundleContextImpl.java:734)
	at org.eclipse.osgi.framework.internal.core.BundleContextImpl.start(BundleContextImpl.java:683)
	at org.eclipse.osgi.framework.internal.core.BundleHost.startWorker(BundleHost.java:381)
	at org.eclipse.osgi.framework.internal.core.AbstractBundle.resume(AbstractBundle.java:389)
	at org.eclipse.osgi.framework.internal.core.Framework.resumeBundle(Framework.java:1130)
	at org.eclipse.osgi.framework.internal.core.StartLevelManager.resumeBundles(StartLevelManager.java:559)
	at org.eclipse.osgi.framework.internal.core.StartLevelManager.resumeBundles(StartLevelManager.java:544)
	at org.eclipse.osgi.framework.internal.core.StartLevelManager.incFWSL(StartLevelManager.java:457)
	at org.eclipse.osgi.framework.internal.core.StartLevelManager.doSetStartLevel(StartLevelManager.java:243)
	at org.eclipse.osgi.framework.internal.core.StartLevelManager.dispatchEvent(StartLevelManager.java:438)
	at org.eclipse.osgi.framework.internal.core.StartLevelManager.dispatchEvent(StartLevelManager.java:1)
	at org.eclipse.osgi.framework.eventmgr.EventManager.dispatchEvent(EventManager.java:230)
	at org.eclipse.osgi.framework.eventmgr.EventManager$EventThread.run(EventManager.java:340)
Caused by: java.lang.IllegalStateException: Profile SDKProfile is not current. Expected timestamp 0 but was 0.
	at org.eclipse.equinox.internal.p2.engine.SimpleProfileRegistry.lockProfile(SimpleProfileRegistry.java:758)
	at org.eclipse.equinox.internal.p2.engine.Engine.perform(Engine.java:67)
	at org.eclipse.equinox.internal.p2.engine.Engine.perform(Engine.java:44)
	at org.eclipse.equinox.internal.p2.reconciler.dropins.ProfileSynchronizer.executePlan(ProfileSynchronizer.java:768)
	at org.eclipse.equinox.internal.p2.reconciler.dropins.ProfileSynchronizer.performAddRemove(ProfileSynchronizer.java:189)
	at org.eclipse.equinox.internal.p2.reconciler.dropins.ProfileSynchronizer.synchronize(ProfileSynchronizer.java:128)
	at org.eclipse.equinox.internal.p2.reconciler.dropins.Activator.synchronize(Activator.java:461)
	at org.eclipse.equinox.internal.p2.reconciler.dropins.Activator.start(Activator.java:176)
	at org.eclipse.osgi.framework.internal.core.BundleContextImpl$1.run(BundleContextImpl.java:711)
	at java.security.AccessController.doPrivileged(Native Method)
	at org.eclipse.osgi.framework.internal.core.BundleContextImpl.startActivator(BundleContextImpl.java:702)
	... 12 more
Root exception:
java.lang.IllegalStateException: Profile SDKProfile is not current. Expected timestamp 0 but was 0.
	at org.eclipse.equinox.internal.p2.engine.SimpleProfileRegistry.lockProfile(SimpleProfileRegistry.java:758)
	at org.eclipse.equinox.internal.p2.engine.Engine.perform(Engine.java:67)
	at org.eclipse.equinox.internal.p2.engine.Engine.perform(Engine.java:44)
	at org.eclipse.equinox.internal.p2.reconciler.dropins.ProfileSynchronizer.executePlan(ProfileSynchronizer.java:768)
	at org.eclipse.equinox.internal.p2.reconciler.dropins.ProfileSynchronizer.performAddRemove(ProfileSynchronizer.java:189)
	at org.eclipse.equinox.internal.p2.reconciler.dropins.ProfileSynchronizer.synchronize(ProfileSynchronizer.java:128)
	at org.eclipse.equinox.internal.p2.reconciler.dropins.Activator.synchronize(Activator.java:461)
	at org.eclipse.equinox.internal.p2.reconciler.dropins.Activator.start(Activator.java:176)
	at org.eclipse.osgi.framework.internal.core.BundleContextImpl$1.run(BundleContextImpl.java:711)
	at java.security.AccessController.doPrivileged(Native Method)
	at org.eclipse.osgi.framework.internal.core.BundleContextImpl.startActivator(BundleContextImpl.java:702)
	at org.eclipse.osgi.framework.internal.core.BundleContextImpl.start(BundleContextImpl.java:683)
	at org.eclipse.osgi.framework.internal.core.BundleHost.startWorker(BundleHost.java:381)
	at org.eclipse.osgi.framework.internal.core.AbstractBundle.resume(AbstractBundle.java:389)
	at org.eclipse.osgi.framework.internal.core.Framework.resumeBundle(Framework.java:1130)
	at org.eclipse.osgi.framework.internal.core.StartLevelManager.resumeBundles(StartLevelManager.java:559)
	at org.eclipse.osgi.framework.internal.core.StartLevelManager.resumeBundles(StartLevelManager.java:544)
	at org.eclipse.osgi.framework.internal.core.StartLevelManager.incFWSL(StartLevelManager.java:457)
	at org.eclipse.osgi.framework.internal.core.StartLevelManager.doSetStartLevel(StartLevelManager.java:243)
	at org.eclipse.osgi.framework.internal.core.StartLevelManager.dispatchEvent(StartLevelManager.java:438)
	at org.eclipse.osgi.framework.internal.core.StartLevelManager.dispatchEvent(StartLevelManager.java:1)
	at org.eclipse.osgi.framework.eventmgr.EventManager.dispatchEvent(EventManager.java:230)
	at org.eclipse.osgi.framework.eventmgr.EventManager$EventThread.run(EventManager.java:340)
Comment 2 Terry Parker CLA 2015-03-02 12:54:03 EST
This can occur quite frequently for installations that support any kind of automated update, since the user can issue an update at the same time.


Are all of these provisioning jobs performed int Jobs? For the automated update I wrote, I'm using the org.eclipse.equinox.p2.operations.ProvisioningJob. Can this be solved by creating a mutually exclusive scheduling rule that all of these provisioning jobs support.
Comment 3 Pascal Rapicault CLA 2015-03-31 12:42:09 EDT
(In reply to Terry Parker from comment #2)
> This can occur quite frequently for installations that support any kind of
> automated update, since the user can issue an update at the same time.
> 
> 
> Are all of these provisioning jobs performed int Jobs? For the automated
> update I wrote, I'm using the
> org.eclipse.equinox.p2.operations.ProvisioningJob. Can this be solved by
> creating a mutually exclusive scheduling rule that all of these provisioning
> jobs support.
   At the lowest level p2 does not force the usage of Jobs. The work happens in the thread that invokes p2. In order to avoid inconsistencies that could arise from modifying an installation from multiple threads, p2 locks the profile and checks timestamps. This is what is being shown in Dani's stack trace, which is a normal condition of p2's behavior.

Now whether a rule on jobs could help, I'm not sure since p2 operations are always invoked in two phases. In a first phase dependencies are resolved, then modifications are made to the install, and it is those two operations that would have to be protected, and they would need to be protected properly identified.

Finally, I'm not really surprised that the reconciler is not multi-process safe. This has never been a design requirement.
Comment 4 Eclipse Genie CLA 2020-03-06 17:17:23 EST
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. As such, we're closing this bug.

If you have further information on the current state of the bug, please add it and reopen this bug. 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.