javax.management.StandardMBean should not use synchronized(this)

XMLWordPrintable

    • Type: Bug
    • Resolution: Fixed
    • Priority: P3
    • 6
    • Affects Version/s: 6
    • Component/s: core-svc
    • None
    • b63
    • generic
    • generic

      Certain visible methods in javax.management.StandardMBean, such as getCachedMBeanInfo, are synchronized. Since one of the ways to use this class is to subclass it, this can lead to unexpected deadlocks if the subclass also has synchronized methods or equivalently uses synchronized(this). In the example we have seen, a subclass has a synchronized method that performs a blocking operation. This operation cannot complete until another thread finishes an activity that requires doing mbeanServer.getMBeanInfo. Since getMBeanInfo on a StandardMBean calls getCachedMBeanInfo, which is synchronized, there is a deadlock.

            Assignee:
            Shanliang Jiang (Inactive)
            Reporter:
            Eamonn McManus
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

              Created:
              Updated:
              Resolved:
              Imported:
              Indexed: