Details
-
Bug
-
Status: Closed
-
Minor
-
Resolution: Fixed
-
configadmin-1.0.8
-
None
Description
When the update of a ManagedServiceFactoryConfiguration, and the registration of that ManagedServiceFactory are close together or 'crossing', it is possible that the update is delivered twice to the factory.
This seems to happen because of the following interleaving, with line numbers from current trunk, rev 763614
Some notes:
- I would have preferred to add some ascii art MSC, but unfortunately Jira does not allow this
- Time order is top to bottom; I left out many methods for clarity
User thread:
- createFactoryConfiguration(user code)
- config.update(user code)
- factory.addPID(ConfigurationImpl.java:329)
(preempted)
Managed Service Factory Tracker thread:
- ManagedServiceFactoryTracker.addingService(ConfigurationManager.java:1505)
- cm.configure(ConfigurationManager.java:1512)
- updateThread.schedule(ConfigurationManager.java:622) (Schedules a ManagedServiceFactoryUpdate task)
- schedule(UpdateThread.java:109)
Update thread:
- task.run(UpdateThread.java:89)
- ManagedServiceFactoryUpdate.run, cfg.isDelivered()(ConfigurationManager:1096) (is false now)
- cfg.setDelivered( true )(ConfigurationManager:1129)
User thread:
- setDelivered( false )(ConfigurationImpl:338)
- updateThread.schedule(ConfigurationManager:482)
- schedule(UpdateThread.java:109) (Schedules a 'regular' UpdateTask)
Update thread:
- task.run(UpdateThread.java:89)
- UpdateConfiguration.run, config.isDelivered() (is false now, so the configuration is delivered twice!)
In short, there is a possibility in which the ManagedServiceFactoryUpdate task and ConfigurationImpl influence the setDelivered in such a way, that they interfere with eachother.
I do not have a contained testcase at the moment, nor an easy fix. Sorry about that...