Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.
Bug 351519 - [pkgAdmin] refreshPackages incorrectly spans regions
Summary: [pkgAdmin] refreshPackages incorrectly spans regions
Status: RESOLVED FIXED
Alias: None
Product: Equinox
Classification: Eclipse Project
Component: Framework (show other bugs)
Version: unspecified   Edit
Hardware: PC Windows 7
: P3 normal (vote)
Target Milestone: Juno M1   Edit
Assignee: Thomas Watson CLA
QA Contact:
URL:
Whiteboard:
Keywords:
: 404859 (view as bug list)
Depends on:
Blocks: 352484
  Show dependency tree
 
Reported: 2011-07-08 04:15 EDT by Borislav Kapukaranov CLA
Modified: 2013-04-04 10:08 EDT (History)
6 users (show)

See Also:


Attachments
patch with the fix for 3.7.1 (5.55 KB, patch)
2011-07-18 10:52 EDT, Borislav Kapukaranov CLA
no flags Details | Diff
Fix for Juno + testcase (9.81 KB, patch)
2011-07-19 12:04 EDT, Thomas Watson CLA
no flags Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Borislav Kapukaranov CLA 2011-07-08 04:15:44 EDT
Background:
Eclipse Virgo currently runs in a multi-region environment implemented with the help of the recently introduced framework hooks. In both regions it includes SpringDM and Virgo's kernel depends on Spring DM.

When refreshing PackageAdmin gathers all bundles with equal symbolic name and refreshes them all because of https://bugs.eclipse.org/bugs/show_bug.cgi?id=169593. 
This behaviour is fine in a single region framework.
Also PackageAdmin has a global view in a multi-region enviroment as its provided by the framework which too has global view of the system.

Problem:
In Virgo refreshing Spring DM in the USER region, actually refreshes Spring DM also in the KERNEL region and with this a whole lot more of kernel bundles.

I would expect that refreshPackages doesn't span across regions, but work by regarding each region as a separate "refresh area" as was with the old implementation of RFC 138 with two frameworks and two package admins respectively.
Comment 1 Thomas Watson CLA 2011-07-08 08:40:45 EDT
I can think of three options:

1) Stop doing this altogether and never pull in bundles with the same symbolic name.  With old eclipse update it was very common that you would end up with many versions of the same bundle installed.  This hack in the framework really was to work around this poorly designed management agent.  If we did this I would probably want to add a configuration property that could be used to enable the old behavior.

2) Stop doing this if there are any resolver hooks installed.  If resolver hooks are installed then we can probably assume the framework is no longer flat.  I don't really like this option because it adds unpredictable behavior to the framework.

3) Add a configuration option that disables this behavior, but we leave the default as enabled.

I think we should go for option 1) in Juno.  We may need to go with option 3) if this is needed in Indigo SR1.  We can use the same configuration property if needed, but have the default be enabled in Indigo SR1 (3.7.1) and disabled in Juno.  Proposed configuration property:

equinox.refresh.duplicate.bsn = (false|true)

Indigo SR1 (3.7.1) default value is true
Juno (3.8) default value is false
Comment 2 Glyn Normington CLA 2011-07-08 08:46:43 EDT
Sounds good.

This fix is needed most crucially for Virgo 3.5 with its p2 support. 3.5 should be later this year and hopefully can use Equinox 3.7.1.

Also, if this bug becomes a problem in the field for Virgo 3.0, we could ship a Virgo 3.0.1 which can use Equinox 3.7.1 (or a hot fixed version of 3.7 if 3.7.1 is not yet available when 3.0.1 is needed).
Comment 3 Borislav Kapukaranov CLA 2011-07-08 10:43:04 EDT
Sounds good to me too.

I'm only concerned that a property configuring this could be changed during runtime. And this leads to a totally different behaviour, kind of like the bsnversion property at the moment.

Have you thought on how to prevent that or if its really a problem from your perspective?

Apart from that 1) for Juno and 3) for Indigo SR1 is great.
I can prepare a patch for 3) if thats ok?
Comment 4 Thomas Watson CLA 2011-07-08 10:48:29 EDT
(In reply to comment #3)
> Sounds good to me too.
> 
> I'm only concerned that a property configuring this could be changed during
> runtime. And this leads to a totally different behaviour, kind of like the
> bsnversion property at the moment.
> 
> Have you thought on how to prevent that or if its really a problem from your
> perspective?

Typically configuration properties are read once and stored into a final field upon startup.  This way if they are changed at runtime it has no effect.

> 
> Apart from that 1) for Juno and 3) for Indigo SR1 is great.
> I can prepare a patch for 3) if thats ok?

That would be great!  Note we have moved to the git repo (just yesterday) located at http://git.eclipse.org/c/equinox/rt.equinox.framework.git/
Comment 5 Borislav Kapukaranov CLA 2011-07-18 10:52:12 EDT
Created attachment 199840 [details]
patch with the fix for 3.7.1

Here is the patch with the new property and the respective changes in the PackageAdmin/FrameworkWiring implementation. I've tested that on the Virgo-p2 prototype and its working fine.

I've formatted this as a git patch using Egit. In the past I've seen problems with that so if you encounter them, let me know to format a new patch with cygwin (works much better usually).

For a test case I imported the tests project from the git repo and they require an unresolved dependency - org.eclipse.core.tests.harness.CoreTest. Any ideas how to get these running? I was planning to extend the PackageAdmin test suite.
Comment 6 John Ross CLA 2011-07-18 12:02:48 EDT
(In reply to comment #5)
> For a test case I imported the tests project from the git repo and they require
> an unresolved dependency - org.eclipse.core.tests.harness.CoreTest. Any ideas
> how to get these running? I was planning to extend the PackageAdmin test suite.

You'll need the following three projects:

org.eclipse.core.runtime.compatibility.registry
org.eclipse.core.tests.harness
org.eclipse.test.performance

As far as I know, they're only available from the CVS repo at :pserver:anonymous@dev.eclipse.org:/cvsroot/eclipse.
Comment 7 Thomas Watson CLA 2011-07-18 15:15:22 EDT
(In reply to comment #6)
> (In reply to comment #5)
> > For a test case I imported the tests project from the git repo and they require
> > an unresolved dependency - org.eclipse.core.tests.harness.CoreTest. Any ideas
> > how to get these running? I was planning to extend the PackageAdmin test suite.
> 
> You'll need the following three projects:
> 
> org.eclipse.core.runtime.compatibility.registry
> org.eclipse.core.tests.harness

These two projects are located in the git repo:

http://git.eclipse.org/c/platform/eclipse.platform.runtime.git/


> org.eclipse.test.performance
> 
> As far as I know, they're only available from the CVS repo at
> :pserver:anonymous@dev.eclipse.org:/cvsroot/eclipse.

org.eclipse.test.performance still lives in CVS at this moment.

We are still in transition to git so this is going to be awkward until everything has moved over.  Sorry.
Comment 8 Thomas Watson CLA 2011-07-19 12:04:03 EDT
Created attachment 199914 [details]
Fix for Juno + testcase

Here is the fix for Juno with test case.  I will create a separate bug for 3.7.1.
Comment 9 Thomas Watson CLA 2011-07-19 13:14:56 EDT
Patch released to Juno.  Note that right not the default value is still false in Juno.
Comment 11 Thomas Watson CLA 2013-04-04 10:08:39 EDT
*** Bug 404859 has been marked as a duplicate of this bug. ***