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

Webconsole Memory Usage Plugin can cause deadlock

    XMLWordPrintableJSON

    Details

      Description

      When the o.a.f.webconsole.plugins.memoryusage bundle is refreshed it is possible that it causes a deadlock because it has dynamic imports that are only triggered from inside a service factory callback that is synchronized.

      That can cause the following deadlock situation:

      "CM Configuration Updater (ManagedService Update: pid=[org.apache.felix.webconsole.plugins.memoryusage.internal.MemoryUsageConfigurator])" #9822 daemon prio=5 os_prio=31 tid=0x00007fe7494c1800 nid=0x9607 in Object.wait() [0x0000700008f4c000]
         java.lang.Thread.State: WAITING (on object monitor)
      	at java.lang.Object.wait(Native Method)
      	at java.lang.Object.wait(Object.java:502)
      	at org.apache.felix.framework.Felix.acquireGlobalLock(Felix.java:5366)
      	- locked <0x00000006c0261148> (a [Ljava.lang.Object;)
      	at org.apache.felix.framework.StatefulResolver.resolve(StatefulResolver.java:528)
      	at org.apache.felix.framework.BundleWiringImpl.searchDynamicImports(BundleWiringImpl.java:1717)
      	at org.apache.felix.framework.BundleWiringImpl.findClassOrResourceByDelegation(BundleWiringImpl.java:1617)
      	at org.apache.felix.framework.BundleWiringImpl.access$200(BundleWiringImpl.java:80)
      	at org.apache.felix.framework.BundleWiringImpl$BundleClassLoader.loadClass(BundleWiringImpl.java:2053)
      	at java.lang.ClassLoader.loadClass(ClassLoader.java:357)
      	at java.lang.ClassLoader.defineClass1(Native Method)
      	at java.lang.ClassLoader.defineClass(ClassLoader.java:763)
      	at org.apache.felix.framework.BundleWiringImpl$BundleClassLoader.defineClass(BundleWiringImpl.java:2410)
      	at org.apache.felix.framework.BundleWiringImpl$BundleClassLoader.findClass(BundleWiringImpl.java:2194)
      	at org.apache.felix.framework.BundleWiringImpl.findClassOrResourceByDelegation(BundleWiringImpl.java:1607)
      	at org.apache.felix.framework.BundleWiringImpl.access$200(BundleWiringImpl.java:80)
      	at org.apache.felix.framework.BundleWiringImpl$BundleClassLoader.loadClass(BundleWiringImpl.java:2053)
      	at java.lang.ClassLoader.loadClass(ClassLoader.java:357)
      	at org.apache.felix.webconsole.plugins.memoryusage.internal.Activator$3.createObject(Activator.java:72)
      	at org.apache.felix.webconsole.plugins.memoryusage.internal.Activator$AbstractServiceFactory.getService(Activator.java:121)
      	- locked <0x000000077ce19440> (a org.apache.felix.webconsole.plugins.memoryusage.internal.Activator$3)
      	at org.apache.felix.framework.ServiceRegistrationImpl.getFactoryUnchecked(ServiceRegistrationImpl.java:347)
      	at org.apache.felix.framework.ServiceRegistrationImpl.getService(ServiceRegistrationImpl.java:247)
      	at org.apache.felix.framework.ServiceRegistry.getService(ServiceRegistry.java:350)
      	at org.apache.felix.framework.Felix.getService(Felix.java:3737)
      	at org.apache.felix.framework.BundleContextImpl.getService(BundleContextImpl.java:470)
      	at org.apache.felix.cm.impl.helper.BaseTracker.getRealService(BaseTracker.java:207)
      	at org.apache.felix.cm.impl.helper.ManagedServiceTracker.updateService(ManagedServiceTracker.java:102)
      	at org.apache.felix.cm.impl.helper.ManagedServiceTracker.provideConfiguration(ManagedServiceTracker.java:85)
      	at org.apache.felix.cm.impl.ConfigurationManager$ManagedServiceUpdate.provide(ConfigurationManager.java:1097)
      	at org.apache.felix.cm.impl.ConfigurationManager$ManagedServiceUpdate.run(ConfigurationManager.java:1053)
      	at org.apache.felix.cm.impl.UpdateThread.run0(UpdateThread.java:138)
      	at org.apache.felix.cm.impl.UpdateThread.run(UpdateThread.java:105)
      	at java.lang.Thread.run(Thread.java:745)
      
      "FelixFrameworkWiring" #21 daemon prio=5 os_prio=31 tid=0x00007fe7450eb000 nid=0x6103 waiting for monitor entry [0x000070000790c000]
         java.lang.Thread.State: BLOCKED (on object monitor)
      	at org.apache.felix.webconsole.plugins.memoryusage.internal.Activator$AbstractServiceFactory.getService(Activator.java:118)
      	- waiting to lock <0x000000077ce19440> (a org.apache.felix.webconsole.plugins.memoryusage.internal.Activator$3)
      	at org.apache.felix.framework.ServiceRegistrationImpl.getFactoryUnchecked(ServiceRegistrationImpl.java:347)
      	at org.apache.felix.framework.ServiceRegistrationImpl.getService(ServiceRegistrationImpl.java:247)
      	at org.apache.felix.framework.ServiceRegistry.getService(ServiceRegistry.java:350)
      	at org.apache.felix.framework.Felix.getService(Felix.java:3737)
      	at org.apache.felix.framework.BundleContextImpl.getService(BundleContextImpl.java:470)
      	at org.apache.felix.metatype.internal.ManagedServiceTracker.addingService(ManagedServiceTracker.java:52)
      	at org.osgi.util.tracker.ServiceTracker$Tracked.customizerAdding(ServiceTracker.java:941)
      	at org.osgi.util.tracker.ServiceTracker$Tracked.customizerAdding(ServiceTracker.java:870)
      	at org.osgi.util.tracker.AbstractTracked.trackAdding(AbstractTracked.java:256)
      	at org.osgi.util.tracker.AbstractTracked.trackInitial(AbstractTracked.java:183)
      	at org.osgi.util.tracker.ServiceTracker.open(ServiceTracker.java:318)
      	at org.osgi.util.tracker.ServiceTracker.open(ServiceTracker.java:261)
      	at org.apache.felix.metatype.internal.MetaTypeServiceImpl.<init>(MetaTypeServiceImpl.java:76)
      	at org.apache.felix.metatype.internal.Activator.start(Activator.java:107)
      	at org.apache.felix.framework.util.SecureAction.startActivator(SecureAction.java:697)
      	at org.apache.felix.framework.Felix.activateBundle(Felix.java:2240)
      	at org.apache.felix.framework.Felix.startBundle(Felix.java:2146)
      	at org.apache.felix.framework.Felix$RefreshHelper.restart(Felix.java:5097)
      	at org.apache.felix.framework.Felix.refreshPackages(Felix.java:4291)
      	at org.apache.felix.framework.FrameworkWiringImpl.run(FrameworkWiringImpl.java:188)
      	at java.lang.Thread.run(Thread.java:745)
      

        Attachments

          Activity

            People

            • Assignee:
              karlpauls Karl Pauls
              Reporter:
              karlpauls Karl Pauls
            • Votes:
              0 Vote for this issue
              Watchers:
              1 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: