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

Agemo Cui commented on FELIX-1185:
----------------------------------

I understand what you concern.
Since I just looked at the scr code and didn't read it completely, it's a big 
risk to make the deactivation synchronous.

However, I have the alternate way that could fix this problem too. But I'm not 
sure whether it will cause other problems or will cause a big code change which 
is also a big risk.

The dependency relation is in fact a tree. If we look at the dependent 
component as the parent node of a certain component, then before we schedule a 
disposal task of a dependent component, could we use Depth First algorithm to 
schedule all the disposal tasks.
That is to say, if component A is dependent on component B and now B is going 
to be disposed, could we schedule A's disabling before B's disabling? Since the 
tasks are queued, that should work though asynchronously.

> If a static/mandatory reference to a service is unregistered, the component 
> should be deactivated synchronously instead of asynchronously
> -----------------------------------------------------------------------------------------------------------------------------------------
>
>                 Key: FELIX-1185
>                 URL: https://issues.apache.org/jira/browse/FELIX-1185
>             Project: Felix
>          Issue Type: Bug
>          Components: Declarative Services (SCR)
>    Affects Versions: scr-1.0.8
>            Reporter: Agemo Cui
>             Fix For: scr-1.0.10
>
>
> In the specification cmpn 112.3.3 Reference Policy, it says "Component 
> configurations are deactivated before any bound service for a reference 
> having a static policy becomes unavailable."
> My understanding is the deactivate method of the component must be called 
> before any unbind method for a static/mandatory reference is called. And it's 
> reasonable for a static/mandatory reference to be still available in the 
> deactivate method.
> If the component is deactivated asynchronously when a static/mandatory 
> reference to a service is unregistered, then it's possible that the unbind 
> method is called before the deactivate method is called, which makes the 
> service unavailable in the deactivate method.
> This bug may relate to FELIX-1178.
> The fix for this bug should also fix FELIX-1178. No need to add a new flag.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.

Reply via email to