You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@felix.apache.org by "Angelo van der Sijpt (JIRA)" <ji...@apache.org> on 2009/05/12 14:01:45 UTC

[jira] Created: (FELIX-1146) ConfigAdmin can deliver updates to a managed service factory more than once

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

                 Key: FELIX-1146
                 URL: https://issues.apache.org/jira/browse/FELIX-1146
             Project: Felix
          Issue Type: Bug
          Components: Configuration Admin
    Affects Versions: configadmin-1.0.8
            Reporter: Angelo van der Sijpt
            Priority: Minor


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

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Updated: (FELIX-1146) ConfigAdmin can deliver updates to a managed service factory more than once

Posted by "Angelo van der Sijpt (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/FELIX-1146?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Angelo van der Sijpt updated FELIX-1146:
----------------------------------------

    Attachment: ActivatorWithDependencyManager.java
                Activator.java

I created a minimal example that shows the described behavior. I also found out that this behavior is more easily reproducable when using the dependency manager (I didn't have the time to find out why).

ActivatorWithDependencyManager.java contains a bundle activator that, when used as an activator for a bundle, will demonstrate the problem. Activator.java contains the same situation, just using basic service primitives.

> ConfigAdmin can deliver updates to a managed service factory more than once
> ---------------------------------------------------------------------------
>
>                 Key: FELIX-1146
>                 URL: https://issues.apache.org/jira/browse/FELIX-1146
>             Project: Felix
>          Issue Type: Bug
>          Components: Configuration Admin
>    Affects Versions: configadmin-1.0.8
>            Reporter: Angelo van der Sijpt
>            Priority: Minor
>         Attachments: Activator.java, ActivatorWithDependencyManager.java
>
>
> 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...

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Commented: (FELIX-1146) ConfigAdmin can deliver updates to a managed service factory more than once

Posted by "Angelo van der Sijpt (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/FELIX-1146?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12747313#action_12747313 ] 

Angelo van der Sijpt commented on FELIX-1146:
---------------------------------------------

I have not been able to reproduce the issue with 1.2.0, so this looks fine to me! Thanks for the fix!

> ConfigAdmin can deliver updates to a managed service factory more than once
> ---------------------------------------------------------------------------
>
>                 Key: FELIX-1146
>                 URL: https://issues.apache.org/jira/browse/FELIX-1146
>             Project: Felix
>          Issue Type: Bug
>          Components: Configuration Admin
>    Affects Versions: configadmin-1.0.8
>            Reporter: Angelo van der Sijpt
>            Assignee: Felix Meschberger
>            Priority: Minor
>             Fix For: configadmin-1.2.0
>
>         Attachments: Activator.java, ActivatorWithDependencyManager.java
>
>
> 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...

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Resolved: (FELIX-1146) ConfigAdmin can deliver updates to a managed service factory more than once

Posted by "Felix Meschberger (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/FELIX-1146?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Felix Meschberger resolved FELIX-1146.
--------------------------------------

       Resolution: Fixed
    Fix Version/s: configadmin-1.0.12
         Assignee: Felix Meschberger

I think with the change in Rev. 805668 the probability of such a case has been reduced and I tend to think this issue can be resolved.

Unfortunately, since this is a very time-critical issue, I cannot test it really for now and guarantee it works.

But if you could use a current trunk build and try again with your test case in your environment. That would be great. Thanks.

> ConfigAdmin can deliver updates to a managed service factory more than once
> ---------------------------------------------------------------------------
>
>                 Key: FELIX-1146
>                 URL: https://issues.apache.org/jira/browse/FELIX-1146
>             Project: Felix
>          Issue Type: Bug
>          Components: Configuration Admin
>    Affects Versions: configadmin-1.0.8
>            Reporter: Angelo van der Sijpt
>            Assignee: Felix Meschberger
>            Priority: Minor
>             Fix For: configadmin-1.0.12
>
>         Attachments: Activator.java, ActivatorWithDependencyManager.java
>
>
> 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...

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Closed: (FELIX-1146) ConfigAdmin can deliver updates to a managed service factory more than once

Posted by "Felix Meschberger (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/FELIX-1146?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Felix Meschberger closed FELIX-1146.
------------------------------------


Close all issues now this version has been released

> ConfigAdmin can deliver updates to a managed service factory more than once
> ---------------------------------------------------------------------------
>
>                 Key: FELIX-1146
>                 URL: https://issues.apache.org/jira/browse/FELIX-1146
>             Project: Felix
>          Issue Type: Bug
>          Components: Configuration Admin
>    Affects Versions: configadmin-1.0.8
>            Reporter: Angelo van der Sijpt
>            Assignee: Felix Meschberger
>            Priority: Minor
>             Fix For: configadmin-1.2.0
>
>         Attachments: Activator.java, ActivatorWithDependencyManager.java
>
>
> 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...

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.