felix-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Paolo Antinori (JIRA)" <j...@apache.org>
Subject [jira] [Commented] (FELIX-5576) SCR components and factoryPids random issues
Date Thu, 09 Mar 2017 11:58:37 GMT

    [ https://issues.apache.org/jira/browse/FELIX-5576?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15902934#comment-15902934
] 

Paolo Antinori commented on FELIX-5576:
---------------------------------------

I have added a unit test:

https://github.com/paoloantinori/felix/commit/ab7f7b97e12910568e811a4869f588fb8c991025

To circumvent issues with package visibility and final methods, though, I had to change visibility
of an inner class and of a method to `protected`

> SCR components and factoryPids random issues
> --------------------------------------------
>
>                 Key: FELIX-5576
>                 URL: https://issues.apache.org/jira/browse/FELIX-5576
>             Project: Felix
>          Issue Type: Bug
>          Components: Declarative Services (SCR)
>    Affects Versions: scr-1.8.2
>            Reporter: Paolo Antinori
>            Assignee: Guillaume Nodet
>
> This affects {{mvn:org.apache.felix/org.apache.felix.scr/1.8.2}}.
> There is an issue with SCR, {{ConfigAdmin}} and {{factoryPids}} that leads to possible
situation when {{ConfigAdmin}} update events are discarded.
> The issue is present in case of an interweaving of {{CM_LOCATION_CHANGED}} event.
> If that event is processed, it changes updates the reference of {{TargetPID}} with the
wrong one (uses {{instance}} one instead than a {{service}} one) basically turning the stored
reference unreachable, thus discarding subsequent update requests.
> The following code fixes the issue.
> {code}
> ✔ /data/repositories/work/felix [org.apache.felix.scr-1.8.2|●1✚ 1…288] 
> 09:30 $ git diff --cached
> diff --git a/src/main/java/org/apache/felix/scr/impl/config/ConfigurationSupport.java
b/src/main/java/org/apache/felix/scr/impl/config/ConfigurationSupport.java
> index e2f63e9..3a15073 100644
> --- a/src/main/java/org/apache/felix/scr/impl/config/ConfigurationSupport.java
> +++ b/src/main/java/org/apache/felix/scr/impl/config/ConfigurationSupport.java
> @@ -357,8 +357,8 @@ public class ConfigurationSupport implements ConfigurationListener
>                                  //this is a better match, delete old before setting
new
>                                  componentHolder.configurationDeleted( pid.getServicePid()
);
>                              }
> -                            componentHolder.configurationUpdated( pid.getServicePid(),
configInfo.getProps(),
> -                                    configInfo.getChangeCount(), pid );
> +                            componentHolder.configurationUpdated( targetedPid.getServicePid(),
configInfo.getProps(),
> +                                    configInfo.getChangeCount(), targetedPid );
>                          }
> {code}



--
This message was sent by Atlassian JIRA
(v6.3.15#6346)

Mime
View raw message