Guillaume Nodet created FELIX-4308:
--------------------------------------

             Summary: Deadlock with dynamic imports
                 Key: FELIX-4308
                 URL: https://issues.apache.org/jira/browse/FELIX-4308
             Project: Felix
          Issue Type: Bug
          Components: Framework
    Affects Versions: framework-4.2.1
            Reporter: Guillaume Nodet


When a bundle has some dynamic imports, the framework will try to grab the 
bundle lock.  However, this is triggered by a simple class load, which can not 
be easily controller.

This is quite problematic with concurrent access to bundles and can result in 
deadlocks.
My use case is the following:
  * Configuration admin calls on the service registered by the same bundle 
which triggers a getService and a bundle#classLoad
  * a thread does a bundle refresh on a bundle

We end up with the following deadlock:
  * thread 1
     - configadmin wants to update the service
     - the framework calls getService grabbing a lock on the service 
registration
     - the service is backed by scr and triggers a class load, waiting to grab 
the global lock
  * thread 2
     - refreshPackages (acquire global lock)
     - stopBundle (acquire bundle lock)
     - unregister services
     - blocked on the service registration




--
This message was sent by Atlassian JIRA
(v6.1#6144)

Reply via email to