You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@felix.apache.org by "Paolo Antinori (JIRA)" <ji...@apache.org> on 2017/03/09 11:59:38 UTC

[jira] [Comment Edited] (FELIX-5576) SCR components and factoryPids random issues

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

Paolo Antinori edited comment on FELIX-5576 at 3/9/17 11:58 AM:
----------------------------------------------------------------

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


was (Author: paolo.antinori):
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
>         Attachments: 0001-FELIX-5576-added-unit-test-and-modified-visibility-o.patch
>
>
> 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)