Uploaded image for project: 'Pax Logging'
  1. Pax Logging
  2. PAXLOGGING-26

deadlock when pax logging sends an event to EventAdmin

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Critical
    • Resolution: Fixed
    • Affects Version/s: 1.0-RC2
    • Fix Version/s: None
    • Component/s: None
    • Labels:
      None
    • Environment:
      Felix

      Description

      I have two threads that often deadlock.

      • thread 1 logs the "unget" of my service, this holds a lock from the Felix registry, it's waiting for a linked list in EventAdminTracker
      • thread 2 (felix event dispatch thread) logs a framework event, holds the linked list in EventAdminTracker and tries to obtain the felix registry lock in order to find the Event Admin service.

      In my humble opinion, this is caused by pax logging (EventAdminTracker), not adhering to the rule that an OSGi service should not hold locks when calling the framework.
      Of course, one can debate whether Felix should hold a lock when calling ServiceFactory.ungetService(), but still, pax logging should not hold a lock when posting an event.

        Gliffy Diagrams

        1. deadlock.txt
          4 kB
          Peter Doornbosch

          Activity

          Hide
          niclas@hedhman.org Niclas Hedhman added a comment -

          I agree with your conclusion, and I have no defense why the code has ended up the way it is. I must have had brain hemmorage that day... Will fix asap.

          Show
          niclas@hedhman.org Niclas Hedhman added a comment - I agree with your conclusion, and I have no defense why the code has ended up the way it is. I must have had brain hemmorage that day... Will fix asap.
          Hide
          niclas@hedhman.org Niclas Hedhman added a comment -

          Fixed in commit 11508, so should be included in the 1.1.0 release of Pax Logging on the 8th May 2008.

          Show
          niclas@hedhman.org Niclas Hedhman added a comment - Fixed in commit 11508, so should be included in the 1.1.0 release of Pax Logging on the 8th May 2008.

            People

            • Assignee:
              niclas@hedhman.org Niclas Hedhman
              Reporter:
              peter.doornbosch@gmail.com Peter Doornbosch
            • Votes:
              0 Vote for this issue
              Watchers:
              0 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved:

                Development