[
https://issues.apache.org/jira/browse/FELIX-550?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12601593#action_12601593
]
Felix Meschberger commented on FELIX-550:
-----------------------------------------
What can happen is the following:
activateInternal will set the state to active _before_ the component is
registered as a service. If now between setting the state to active and
registering the service, the configuration comes in and reactivation is
triggered, the component may be deactivated immediatly while still registering
the service.
Now, the component is deactivated, the service registered and the component is
activated again and the service registered again.
The problem is to not cycle the component while the component is being
registered as a service.
My first step is to investigate whether it is feasible to set the component to
active only _after_ the component's state is marked active. (yes this would
probably be the right thing, I have to find out, whether it is not done like
that !)
> SCR registers service component twice after stopping/starting a bundle
> ----------------------------------------------------------------------
>
> Key: FELIX-550
> URL: https://issues.apache.org/jira/browse/FELIX-550
> Project: Felix
> Issue Type: Bug
> Components: Declarative Services (SCR)
> Affects Versions: scr-1.0.0
> Environment: JDK 1.6.0_03 / WinXP SP2
> Reporter: Paul Neyens
> Assignee: Felix Meschberger
> Fix For: scr-1.0.1
>
>
> When stopping and starting a bundle (from the shell) that has a component
> which is also registered as a service, this service is registered twice from
> time to time.
> What I am seeing, is that when starting the bundle (after stopping it first),
> the enable method (AbstractComponentManager) is called starting an
> enableInternal' (including an activateInternal) on the component actor thread.
> Approximately at the same time, an update call is made from the configuration
> manager (on some thread from the CM, through method 'update' in
> ImmediateComponentManager's anonymous ManagedService inner class) resulting
> eventually in a call to 'reactivate' which first deactivates
> (deactivateInternal) on the current thread (CM thread). That's where things
> clash, I guess.
> I cannot reproduce this behaviour when logging level is set to debug.
--
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.