[
https://issues.apache.org/jira/browse/FELIX-5315?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15404317#comment-15404317
]
James Watkins-Harvey commented on FELIX-5315:
---------------------------------------------
Actually, there could be an issue if there are more than one ConfigurationAdmin
services in the environment, with one being visible to the SCR bundle and
another one to an impersonated bundle. Though this in itself appears to be a
very unlikely configuration, I can think of some corner cases where it would be
possible: 1) multiple regions with SCR being loaded in a parent region while
ConfigurationAdmin is loaded in a child region; 2) manipulations on
bundle/services visibility done with hooks or a custom resolver. Neither case
would be less an issue with 2.0.4 though, so that should not prevent a release
of the proposed fix, but maybe one may want to think a little more about these
rare yet possible occurrences...
> Unexpected release of ConfigurationAdmin service in
> RegionConfigurationSupport
> -------------------------------------------------------------------------------
>
> Key: FELIX-5315
> URL: https://issues.apache.org/jira/browse/FELIX-5315
> Project: Felix
> Issue Type: Bug
> Components: Configuration Admin, Declarative Services (SCR)
> Affects Versions: scr-2.0.4
> Reporter: James Watkins-Harvey
> Assignee: David Jencks
> Fix For: scr-2.0.6
>
>
> In commit 978a710, RegionConfigurationSupport has been modified to obtain the
> ConfigurationAdmin service through the ConfigurationAdmin's bundle context
> (in getConfigAdmin(), around line 633). However, services acquired through
> that method are then released using the impersonated bundle's context (for
> example in the finally block of configureComponentHolder(ComponentHolder),
> around line 186, and the finally block of getConfigurationInfo(TargetedPID,
> TargetedPID, ComponentHolder, BundleContext), around line 465).
> This cause leak of service on the ConfigurationAdmin's bundle context, as
> well as unexpected early release of services on impersonated bundle contexts,
> causing an IllegalStateException("Configuration Admin service has been
> unregistered") being thrown in
> ConfigurationAdminImpl#getConfigurationManager().
--
This message was sent by Atlassian JIRA
(v6.3.4#6332)