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

Timothy Ward commented on FELIX-5248:
-------------------------------------

Hi David,

The component is immediate and has a configuration policy of required. It has 
one static reference to a service which is satisfied, an activate method which 
takes a bundle context, a type safe configuration object, and a map of the raw 
configuration. It also has a deactivate method which takes no arguments.

The failure flow is as follows:

1. The component's bundle is started and the referenced service is available. 
The configuration requirement correctly prevents activation of any component 
instances.
2. A factory configuration is created for the correct factory pid with some 
config properties. Occasionally one of the config properties is malformed, 
which the component instance detects, throwing an exception from the activate 
method. This correctly prevents that component instance from starting when the 
config is bad.
3. The factory configuration is then updated by the user to correct the 
malformed config property. At this point I do not get the behaviour I expect. I 
expect a component instance to be activated with the updated configuration. 
Instead the component sits there, ignoring the configuration update.

If at this point I disable and enable the component then everything works fine, 
but I don't want to do that as it will disable all of the other instances 
created by other factory configurations. It also works if I delete the old 
config and create a new config, but I don't want to do that either because it's 
an extra set of steps for the user.

I don't think that what I'm asking for is illogical, although I can't find a 
line in the specification which says that it must work. 

I hope this helps. I've tried looking through the felix SCR unit tests, but at 
the moment I'm not entirely sure how I would write a failing test for this 
behaviour.

Tim

> SCR does not reactivate a failed component after a configuration update
> -----------------------------------------------------------------------
>
>                 Key: FELIX-5248
>                 URL: https://issues.apache.org/jira/browse/FELIX-5248
>             Project: Felix
>          Issue Type: Bug
>          Components: Declarative Services (SCR)
>    Affects Versions: scr-2.0.4
>            Reporter: Timothy Ward
>            Priority: Blocker
>
> A configurable SCR component may fail to activate by throwing an exception if 
> the factory configuration contains bad values. If the factory configuration 
> for that component is then updated SCR should attempt to recreate and 
> activate the component. Instead the component sits in the "satisfied" state 
> forever, and updates to the factory configuration are ignored.
> This makes it impossible to "fix" a mistaken configuration without deleting 
> and recreating it.



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)

Reply via email to