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

possible deadlock in ResolverImpl.EnhancedExecutor.await()

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Closed
    • Major
    • Resolution: Fixed
    • resolver-2.0.0, resolver-1.16.0
    • resolver-2.0.2
    • Resolver
    • None

    Description

      The org.apache.felix.resolver.ResolverImpl.EnhancedExecutor class is used by the ResolverImpl in order to run tasks in parallel during a resolve process. When there is work that can happen in parallel the resolver will compute a number of tasks and dispatch each task to the executor and then await for all the tasks to complete. To do this the current code uses an AtomicInteger to count up the number of tasks and then waits for each task to decrement the count back to zero.

      The way the code builds up the tasks recursively leaves it open to incrementing the count and then getting some system failure. For example an OutOfMemoryException, or before OSGi R7 we used to have the executor throw a runtime exception on timeout.

      This can make it such that the count will never reach zero and we end up hanging.

      See https://bugs.eclipse.org/bugs/show_bug.cgi?id=547830 and possible fix that I plan to release soon at https://git.eclipse.org/r/#/c/143026/

      Attachments

        Activity

          People

            tjwatson Tom Watson
            tjwatson Tom Watson
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: