aries-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Holly Cummins (JIRA)" <>
Subject [jira] [Commented] (ARIES-584) Blueprint Managed Service Factory Instantiates Duplicate Service
Date Sat, 21 Jul 2012 13:51:35 GMT


Holly Cummins commented on ARIES-584:

Fixed in the nick of time, before the release. Thanks for the patch. 

I had some difficulty reproducing this problem in our ConfigAdminTest. However, I could sometimes
reproduce it, which makes me conclude there's a concurrency element to the problem. I think
this means the patch isn't quite the right fix, although it definitely points to the right

The updated() method on the CmManagedServiceFactory does checks if the pid exists, and only
registers a service if the pid doesn't, so calling it twice shouldn't be a problem. Problems
do happen when the updated() method is driven by both the init() method and configuration
admin concurrently. My suspicion is that removing the updated() call in the init method exposes
us to problems - if the ConfigurationWatcher is registered too late, it won't be notified
of config changes, and the service won't be registered at all. I've synchronized the updated()
method so that we don't check whether the pid has been registered until we're sure any previous
registration has completed. 

I've also updated our TestConfigAdmin test to make sure only one service is registered, although
this test was passing even for the original code, unless I changed the concurrency by removing
other tests.

I haven't applied a fix to the 0.3.1 branch, since I'm not sure if there will be more releases
on that.
> Blueprint Managed Service Factory Instantiates Duplicate Service
> ----------------------------------------------------------------
>                 Key: ARIES-584
>                 URL:
>             Project: Aries
>          Issue Type: Bug
>          Components: Blueprint
>    Affects Versions: 0.2, 0.3
>         Environment: Mac OSX 10.6.6 / Equinox 3.6.1 / Felix Config Admin 1.2.8 / Aries
Blueprint 0.3 (and 0.2)
>            Reporter: Greg Rapp
>            Assignee: Holly Cummins
>             Fix For: 1.0
>         Attachments: logs.txt,,
> Creating a simple managed service factory, two services are instantiated for a single
factory configuration.

This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators:!default.jspa
For more information on JIRA, see:


View raw message