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

Prevent Deadlock Situation in Felix.acquireGlobalLock

    XMLWordPrintableJSON

Details

    • Improvement
    • Status: Open
    • Major
    • Resolution: Unresolved
    • framework-3.0.7, framework-3.0.8, framework-3.0.9, framework-3.2.0, framework-3.2.1, fileinstall-3.1.10
    • None
    • Framework
    • None

    Description

      Every now and then we encounter deadlock situations which involve the Felix.acquireGlobalLock method. In our use case we have the following aspects which contribute to this:

      (a) The Apache Felix Declarative Services implementation stops components (and thus causes service unregistration) while the bundle lock is being held because this happens in a SynchronousBundleListener while handling the STOPPING bundle event. We have to do this to ensure the bundle is not really stopped yet to properly stop the bundle's components.

      (b) Implementing a special class loader which involves dynamically resolving packages which in turn uses the global lock

      (c) Eclipse Gemini Blueprint implementation which operates asynchronously

      (d) synchronization in application classes

      Often times, I would assume that we can self-heal such complex deadlck situations, if we let acquireGlobalLock time out. Looking at the calles of acquireGlobalLock there seems to already be provision to handle this case since acquireGlobalLock returns true only if the global lock has actually been acquired.

      This issue is kind of a companion to FELIX-3000 where deadlocks involve sending service registration events while holding the bundle lock.

      Attachments

        1. threads_locked_by_camel_type_converter
          65 kB
          Jim Church
        2. threaddump-ise-deadlock.txt
          87 kB
          Dirk Rudolph
        3. FELIX-3067-sling.patch
          1 kB
          Bertrand Delacretaz
        4. FELIX-3067.patch
          2 kB
          Felix Meschberger
        5. felix_unblock_deadlock.patch
          3 kB
          metatech
        6. felix_unblock_deadlock_v4.patch
          9 kB
          metatech
        7. felix_unblock_deadlock_v2.patch
          4 kB
          metatech
        8. felix_unblock_deadlock_2.patch
          9 kB
          metatech

        Issue Links

          Activity

            People

              Unassigned Unassigned
              fmeschbe Felix Meschberger
              Votes:
              1 Vote for this issue
              Watchers:
              9 Start watching this issue

              Dates

                Created:
                Updated: