Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.
Bug 325663 - [localdiscovery] File-based discovery bundle tracker tracks RESOLVE bundles
Summary: [localdiscovery] File-based discovery bundle tracker tracks RESOLVE bundles
Status: RESOLVED FIXED
Alias: None
Product: ECF
Classification: RT
Component: ecf.remoteservices (show other bugs)
Version: 3.3.0   Edit
Hardware: All All
: P3 normal (vote)
Target Milestone: 3.4.0   Edit
Assignee: Scott Lewis CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2010-09-17 18:51 EDT by Neil Bartlett CLA
Modified: 2010-09-30 11:21 EDT (History)
2 users (show)

See Also:


Attachments
mylyn/context/zip (796 bytes, application/octet-stream)
2010-09-30 11:21 EDT, Markus Kuppe CLA
no flags Details

Note You need to log in before you can comment on or make changes to this bug.
Description Neil Bartlett CLA 2010-09-17 18:51:08 EDT
A BundleTracker is used by the file-based discovery bundle org.eclispe.ecf.osgi.services.discovery.local to track bundles that publish a service description using the Remote-Service header. This BundleTracker incorrectly tracks both RESOLVED and ACTIVE bundles.

It does not make sense to track RESOLVED bundles, since then a bundle's contributions cannot be disabled by deactivating it.

The Remote Services Admin specification states that only ACTIVE and STARTING (in the case of lazy activation) bundles should be used.

See method init() of FileBasedDiscoveryImpl.java.
Comment 1 Scott Lewis CLA 2010-09-17 22:08:06 EDT
Fix released to HEAD.

Fix was to replace previously used state mask (36 == RESOLVED | ACTIVE), with:

	bt = new BundleTracker(context, Bundle.ACTIVE | Bundle.STARTING, new BundleTrackerImpl(this));

Thanks Neil for the report.  Resolving as fixed.
Comment 2 Markus Kuppe CLA 2010-09-30 10:49:00 EDT
This fix breaks all three unit tests. https://build.ecf-project.org/hudson/job/C-HEAD-discovery.local.feature/12/testReport/
Comment 3 Markus Kuppe CLA 2010-09-30 10:58:55 EDT
(In reply to comment #2)
> This fix breaks all three unit tests.
> https://build.ecf-project.org/hudson/job/C-HEAD-discovery.local.feature/12/testReport/

The problem appears to be, that now the BundleTracker sends multiple events for the same bundle contributions in the STARTING as well as the ACTIVE state.
Comment 4 Markus Kuppe CLA 2010-09-30 11:21:39 EDT
Removing lazystart from both "...poststarted" test bundles fixes the unit tests. This is a correct fix as those tests are supposed to test cases where bundles are activated explicitly. They are not meant to test lazy activation. ATM we simply don't test lazy activation.
Comment 5 Markus Kuppe CLA 2010-09-30 11:21:41 EDT
Created attachment 179969 [details]
mylyn/context/zip