You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@felix.apache.org by "David Jencks (JIRA)" <ji...@apache.org> on 2013/03/09 05:53:12 UTC

[jira] [Commented] (FELIX-3952) [DS] service events can go missing resulting in hang

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

David Jencks commented on FELIX-3952:
-------------------------------------

This was caused by a rather pathological situation, but we can avoid the deadlock anyway.

DS delayed service 1 registered under interface A

DS service 2 used a SingleDynamic greedy reference to bind 1 as A, causing 1 to be instantiated and activated.

The activate registered the same service under A.  This caused replacement of the binding in 2, so we unbound 1.  However we didn't register the event tracking number, say 6, until after the ungetService.

Now 1 has no references so it can be deactivated.... unregistering the just bound service and shutting down 2 with tracking number 7.  Deactivate waits for the tracking number 6 which never arrives.... 7 has to complete first.

The solution is to track before ungetting the service.
                
> [DS] service events can go missing resulting in hang
> ----------------------------------------------------
>
>                 Key: FELIX-3952
>                 URL: https://issues.apache.org/jira/browse/FELIX-3952
>             Project: Felix
>          Issue Type: Bug
>          Components: Declarative Services (SCR)
>    Affects Versions: scr-1.8.0
>            Reporter: David Jencks
>            Assignee: David Jencks
>             Fix For: scr-1.8.0
>
>
> I got a thread dump showing a hang on AbstractComponentManager.waitForTracked.  To start with I'm going to change this to use a lock and condition object so we can detect timeouts and exit with an error logged.

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira