Uploaded image for project: 'Felix'
  1. Felix
  2. FELIX-2391

Potential dead locking issue in OsgiManager.init

    XMLWordPrintableJSON

Details

    • Improvement
    • Status: Closed
    • Major
    • Resolution: Fixed
    • webconsole-3.0.0
    • webconsole-3.1.2
    • Web Console
    • None

    Description

      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.

      Attachments

        1. FELIX-2391.patch
          23 kB
          Felix Meschberger

        Issue Links

          Activity

            People

              fmeschbe Felix Meschberger
              fmeschbe Felix Meschberger
              Votes:
              0 Vote for this issue
              Watchers:
              0 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: