Potential dead locking issue in OsgiManager.init
------------------------------------------------

                 Key: FELIX-2391
                 URL: https://issues.apache.org/jira/browse/FELIX-2391
             Project: Felix
          Issue Type: Improvement
          Components: Web Console
    Affects Versions: webconsole-3.0.0
            Reporter: Felix Meschberger
            Assignee: Felix Meschberger
             Fix For: webconsole-3.0.2


The OsgiManager.init method is called when the OSGiManager is registered with 
the OSGi Http Service and is used to complete the setup of the web console. 
Some implementations of the OSGi Http Service call the init method while 
holding a lock (this is an issue in itself, see FELIX- for the case of the 
Felix implementation).

The current OsgiManager.init methods loads and initializes all predefined 
plugins and configuration printers. This may involve registering services, thus 
calling into the framework. This is a problematic thing while holding a lock.

We have experienced a complex dead lock situation with this setup involving 
bundle installations, configuration updates and web console startup.

To fix this issue, the main setup (and diposal) of the console should be moved:

  * from the init method to the constructor, except recording the ServletContext
  * from the destroy method to the dispose method, except resetting the 
ServletContext

The ServletContext may lazily be set on the init method after actual internal 
setup because plugin services are only actually accessed and initialized 
(init() called) when really needed, which always takes place after init.

On the other hand, the destroy() method must make sure that all plugins which 
are already initialized are destroyed since the servlet context is being taken 
away.

-- 
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