Uploaded image for project: 'Felix'
  1. Felix
  2. FELIX-1146

ConfigAdmin can deliver updates to a managed service factory more than once

    XMLWordPrintableJSON

Details

    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...

      Attachments

        1. Activator.java
          3 kB
          Angelo van der Sijpt
        2. ActivatorWithDependencyManager.java
          3 kB
          Angelo van der Sijpt

        Activity

          People

            fmeschbe Felix Meschberger
            angelovds Angelo van der Sijpt
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: