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

Bug 329685

Summary: [rfc 160] Implement the new coodinator service
Product: [Eclipse Project] Equinox Reporter: Thomas Watson <tjwatson>
Component: CompendiumAssignee: John Ross <jwross>
Status: RESOLVED FIXED QA Contact:
Severity: normal    
Priority: P3 CC: hargrave
Version: 3.7   
Target Milestone: 3.7 M5   
Hardware: PC   
OS: Mac OS X - Carbon (unsup.)   
Whiteboard:
Bug Depends on:    
Bug Blocks: 289124, 329688    
Attachments:
Description Flags
Proposed implementation as project ZIP archive
none
Proposed implementation 2 as project ZIP archive
none
Proposed implementation 3 as project ZIP archive
none
Proposed implementation 4 as project ZIP archive tjwatson: iplog+

Description Thomas Watson CLA 2010-11-08 11:28:46 EST
RFC 160 is being proposed for the OSGi R4.3 compendium specification.  It will be used for enhancements to Configuration Admin (RFC 160).  We will need an implementation in Equinox if we are to support the latest Configuration admin Specification.
Comment 1 Thomas Watson CLA 2010-11-08 11:32:11 EST
John is working on an implementation of this.  I would like to get it released for M4.
Comment 2 John Ross CLA 2010-11-08 18:49:06 EST
Created attachment 182672 [details]
Proposed implementation as project ZIP archive

Attached is iteration 1 of the proposed implementation for review. I think it's in pretty good shape. It's passing the CT which, believe it or not, seems to actually be quite thorough, although I'm sure we will come across some things to add as progress is made. For example, security permission tests still need to be added.

There will be ongoing work such as continuing to add to the JUnit tests (Equinox as well as possibly the CT), clearing up https://www.osgi.org/members/bugzilla/show_bug.cgi?id=1783, optional JMX support, optional TSH support, as well as from any input received here.

RFC 165 should be a big help in driving further testing and hardening the implementation since that work requires a Coordinator. See Bug 329688.
Comment 3 John Ross CLA 2010-11-08 23:43:34 EST
Created attachment 182678 [details]
Proposed implementation 2 as project ZIP archive

Fixes the following issues.

Activator.stop() - added null checks in case of ds

Coordinator.getNextId() - fix so that Long.MAX_VALUE is used as an ID

Coordination.join() - fix so that start time is taken into account if wait() must be called more than once

CoordinationTimerTask.run() - fix to prevent timer thread from stopping

Coordination.addParticipant() - holding lock while calling Coordination.join() can cause deadlock; refactored method
Comment 4 John Ross CLA 2010-11-09 11:44:15 EST
There's still a safety issue with Coordination.addParticipant(). The coordination could terminate before the participant is added resulting in the participant never receiving a callback.
Comment 5 John Ross CLA 2010-11-09 13:28:32 EST
Created attachment 182742 [details]
Proposed implementation 3 as project ZIP archive

Fixed safety issue in Coordination.addParticipant().

Fixed safety issue in Coordination.getParticipants().
Comment 6 Thomas Watson CLA 2010-12-01 11:08:28 EST
We may release the code to CVS before M4, but I am moving this bug to M5 for integrating the code into the build.
Comment 7 John Ross CLA 2010-12-15 10:25:36 EST
Created attachment 185229 [details]
Proposed implementation 4 as project ZIP archive

Contains spec updates from Walldorf F2F as well as a few that have not been finalized but appear to be heading in that direction. Among the latter would be NPE when the reason for the failure is null and IAE when a timeout related value is negative.

Also incorporates changes from Tom's review.

This will be the last submission before release barring any further feedback.
Comment 8 Thomas Watson CLA 2010-12-15 16:53:08 EST
I released the latest project provided by John.  Thanks for the contribution John!

I opened bug 332693 to get the new coordinator bundle integrated into the equinox build.
Comment 9 Thomas Watson CLA 2011-01-26 08:56:28 EST
This should be closed as fixed.  We have a coordinator bundle in the equinox build for M5.  Additional changes are required to the API and implementation.  This is being tracked by bug333507.