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

Deadlock in Dependency

    XMLWordPrintableJSON

Details

    • Task
    • Status: Closed
    • Major
    • Resolution: Fixed
    • ipojo-runtime-1.10.1
    • ipojo-runtime-1.11.0
    • iPOJO
    • None

    Description

      There is a deadlock condition in the dependency class. The dependency class does not follow the synchronization protocol from the dependency model. This leads to the deadlock.

      First Thread:
      Name: fileinstall-/home/torito/workspace/Cilia/tests/runtime/target/distribution/cilia-remote-distribution/load
      State: BLOCKED on org.apache.felix.ipojo.handlers.dependency.Dependency@1d9aed0 owned by: [iPOJO] pool-248-thread-1
      Total blocked: 3 Total waited: 4

      Stack trace:
      org.apache.felix.ipojo.handlers.dependency.Dependency.isFrozen(Dependency.java:236)
      org.apache.felix.ipojo.util.DependencyModel.onChange(DependencyModel.java:978)
      org.apache.felix.ipojo.dependency.impl.ServiceReferenceManager.fireUpdate(ServiceReferenceManager.java:448)
      org.apache.felix.ipojo.dependency.impl.ServiceReferenceManager.onNewMatchingService(ServiceReferenceManager.java:412)
      org.apache.felix.ipojo.dependency.impl.ServiceReferenceManager.addedService(ServiceReferenceManager.java:391)
      org.apache.felix.ipojo.util.Tracker$Tracked.trackAdding(Tracker.java:711)
      org.apache.felix.ipojo.util.Tracker$Tracked.track(Tracker.java:672)
      org.apache.felix.ipojo.util.Tracker$Tracked.serviceChanged(Tracker.java:633)
      org.apache.felix.framework.util.EventDispatcher.invokeServiceListenerCallback(EventDispatcher.java:932)
      org.apache.felix.framework.util.EventDispatcher.fireEventImmediately(EventDispatcher.java:793)
      org.apache.felix.framework.util.EventDispatcher.fireServiceEvent(EventDispatcher.java:543)
      org.apache.felix.framework.Felix.fireServiceEvent(Felix.java:4260)
      org.apache.felix.framework.Felix.registerService(Felix.java:3275)
      org.apache.felix.framework.BundleContextImpl.registerService(BundleContextImpl.java:346)
      org.apache.felix.framework.BundleContextImpl.registerService(BundleContextImpl.java:320)
      org.apache.felix.ipojo.IPojoContext.registerService(IPojoContext.java:414)
      org.apache.felix.ipojo.handlers.architecture.ArchitectureHandler.__M_configure(ArchitectureHandler.java:64)
      org.apache.felix.ipojo.handlers.architecture.ArchitectureHandler.configure(ArchitectureHandler.java)
      org.apache.felix.ipojo.HandlerManager.init(HandlerManager.java:73)
      org.apache.felix.ipojo.InstanceManager.configure(InstanceManager.java:203)
      org.apache.felix.ipojo.ComponentFactory.createInstance(ComponentFactory.java:177)
      org.apache.felix.ipojo.IPojoFactory.createComponentInstance(IPojoFactory.java:309)

      • locked org.apache.felix.ipojo.ComponentFactory@2a3025
        org.apache.felix.ipojo.IPojoFactory.createComponentInstance(IPojoFactory.java:236)
        org.ow2.chameleon.rose.api.Instance$InstanceCreator.addingService(Instance.java:140)
        org.osgi.util.tracker.ServiceTracker$Tracked.customizerAdding(ServiceTracker.java:896)
        org.osgi.util.tracker.AbstractTracked.trackAdding(AbstractTracked.java:261)
        org.osgi.util.tracker.AbstractTracked.trackInitial(AbstractTracked.java:184)
        org.osgi.util.tracker.ServiceTracker.open(ServiceTracker.java:339)
        org.osgi.util.tracker.ServiceTracker.open(ServiceTracker.java:273)
        org.ow2.chameleon.rose.api.Instance.start(Instance.java:55)
        org.ow2.chameleon.rose.api.Machine.start(Machine.java:72)
        org.ow2.chameleon.rose.configurator.Configurator.__M_install(Configurator.java:134)
        org.ow2.chameleon.rose.configurator.Configurator.install(Configurator.java)
        org.apache.felix.fileinstall.internal.DirectoryWatcher.install(DirectoryWatcher.java:862)
        org.apache.felix.fileinstall.internal.DirectoryWatcher.install(DirectoryWatcher.java:790)
        org.apache.felix.fileinstall.internal.DirectoryWatcher.process(DirectoryWatcher.java:428)
        org.apache.felix.fileinstall.internal.DirectoryWatcher.run(DirectoryWatcher.java:245)

      Second Thread:

      Name: [iPOJO] pool-248-thread-1
      State: WAITING on java.util.concurrent.locks.ReentrantReadWriteLock$NonfairSync@170e93a owned by: fileinstall-/home/torito/workspace/Cilia/tests/runtime/target/distribution/cilia-remote-distribution/load
      Total blocked: 6 Total waited: 2

      Stack trace:
      sun.misc.Unsafe.park(Native Method)
      java.util.concurrent.locks.LockSupport.park(LockSupport.java:156)
      java.util.concurrent.locks.AbstractQueuedSynchronizer.parkAndCheckInterrupt(AbstractQueuedSynchronizer.java:811)
      java.util.concurrent.locks.AbstractQueuedSynchronizer.doAcquireShared(AbstractQueuedSynchronizer.java:941)
      java.util.concurrent.locks.AbstractQueuedSynchronizer.acquireShared(AbstractQueuedSynchronizer.java:1261)
      java.util.concurrent.locks.ReentrantReadWriteLock$ReadLock.lock(ReentrantReadWriteLock.java:594)
      org.apache.felix.ipojo.util.DependencyModel.acquireReadLockIfNotHeld(DependencyModel.java:593)
      org.apache.felix.ipojo.util.DependencyModel.getBindingPolicy(DependencyModel.java:838)
      org.apache.felix.ipojo.handlers.dependency.Dependency.onObjectCreation(Dependency.java:258)

      • locked org.apache.felix.ipojo.handlers.dependency.Dependency@1d9aed0
        org.apache.felix.ipojo.handlers.dependency.DependencyHandler.__M_onCreation(DependencyHandler.java:702)
        org.apache.felix.ipojo.handlers.dependency.DependencyHandler.onCreation(DependencyHandler.java)
        org.apache.felix.ipojo.InstanceManager.getPojoObject(InstanceManager.java:934)
        org.apache.felix.ipojo.handlers.lifecycle.callback.LifecycleCallbackHandler.__M_stateChanged(LifecycleCallbackHandler.java:156)
        org.apache.felix.ipojo.handlers.lifecycle.callback.LifecycleCallbackHandler.stateChanged(LifecycleCallbackHandler.java)
        org.apache.felix.ipojo.InstanceManager.setState(InstanceManager.java:536)
        org.apache.felix.ipojo.InstanceManager.start(InstanceManager.java:418)
        org.apache.felix.ipojo.ComponentFactory.createInstance(ComponentFactory.java:178)
        org.apache.felix.ipojo.IPojoFactory.createComponentInstance(IPojoFactory.java:309)
      • locked org.apache.felix.ipojo.ComponentFactory@114e29e
        org.apache.felix.ipojo.IPojoFactory.createComponentInstance(IPojoFactory.java:236)
        org.apache.felix.ipojo.extender.internal.linker.ManagedType$InstanceSupport$1.call(ManagedType.java:290)
        org.apache.felix.ipojo.extender.internal.linker.ManagedType$InstanceSupport$1.call(ManagedType.java:284)
        org.apache.felix.ipojo.extender.internal.queue.JobInfoCallable.call(JobInfoCallable.java:100)
        java.util.concurrent.FutureTask$Sync.innerRun(FutureTask.java:303)
        java.util.concurrent.FutureTask.run(FutureTask.java:138)
        java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:895)
        java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:918)
        java.lang.Thread.run(Thread.java:662)

      Attachments

        Activity

          People

            clement.escoffier Clement Escoffier
            clement.escoffier Clement Escoffier
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: