You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@sling.apache.org by "Carsten Ziegeler (JIRA)" <ji...@apache.org> on 2012/08/13 14:52:38 UTC

[jira] [Assigned] (SLING-2558) Potential Deadlocks may be caused by AdapterManager

     [ https://issues.apache.org/jira/browse/SLING-2558?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Carsten Ziegeler reassigned SLING-2558:
---------------------------------------

    Assignee: Carsten Ziegeler
    
> Potential Deadlocks may be caused by AdapterManager
> ---------------------------------------------------
>
>                 Key: SLING-2558
>                 URL: https://issues.apache.org/jira/browse/SLING-2558
>             Project: Sling
>          Issue Type: Improvement
>          Components: Extensions
>    Affects Versions: Adapter 2.0.16
>            Reporter: Felix Meschberger
>            Assignee: Carsten Ziegeler
>             Fix For: Adapter 2.0.18
>
>
> The AdapterManager uses a cascade of three synchronized blocks when the AdapterFactoryDescriptor.getFactory() method is called:
>   * synchronized(cache)
>   * synchronized(factories)
>   * synchronized(this)
> A potential deadlock may happen because the AdapterFactoryDescriptor.getFactory() method asks the Declarative Services runtime for a service, which may cause a ServiceFactory service to be instantiated (with a whole cascade of potential secondary actions depending on what happens on this instantiation).
> The last block can probably simply be removed while the others definitely have to be refactored to not be the cause or participants in deadlock situations. The reason for this is, that (a) synchronized blocks must not be too large and (b) no Java locks should be held when calling into the OSGi Framework, which happens in the AdapterFactoryDescriptor.getFactory method.

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira