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

SCR components and factoryPids random issues

    XMLWordPrintableJSON

Details

    • Patch

    Description

      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.

      ✔ /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 );
                               }
      

      Attachments

        Activity

          People

            gnodet Guillaume Nodet
            paolo.antinori Paolo Antinori
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: