felix-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Jim Church (JIRA)" <j...@apache.org>
Subject [jira] [Commented] (FELIX-3067) Prevent Deadlock Situation in Felix.acquireGlobalLock
Date Thu, 02 May 2013 21:52:15 GMT

    [ https://issues.apache.org/jira/browse/FELIX-3067?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13647939#comment-13647939
] 

Jim Church commented on FELIX-3067:
-----------------------------------

Consistently recreatable if using Camel.
   1.  In bundle A: Define a Camel Context and define a Camel TypeConverter (in META-INF/services
folder).  Import one or more packages from Bundle B.
   2.  Hot Deploy Bundle B.

Simply removing the TypeConverter definition corrects the problem.


Name: Camel (svc-insertion-order-api-camel-context) thread #15 - ShutdownTask
State: WAITING on [Ljava.lang.Object;@4f7df5fa
Total blocked: 0  Total waited: 50

Stack trace: 
java.lang.Object.wait(Native Method)
java.lang.Object.wait(Object.java:503)
org.apache.felix.framework.Felix.acquireGlobalLock(Felix.java:4995)
org.apache.felix.framework.Felix.resolveBundles(Felix.java:3492)
org.apache.felix.framework.Felix.findBundleEntries(Felix.java:1563)
org.apache.felix.framework.BundleImpl.findEntries(BundleImpl.java:293)
org.apache.camel.impl.osgi.Activator$BundleTypeConverterLoader$Loader.load(Activator.java:335)
org.apache.camel.impl.osgi.Activator$BundleTypeConverterLoader.load(Activator.java:278)
   - locked org.apache.camel.impl.osgi.Activator$BundleTypeConverterLoader@13ae5a25
org.apache.camel.core.osgi.OsgiTypeConverter.createRegistry(OsgiTypeConverter.java:175)
org.apache.camel.core.osgi.OsgiTypeConverter.getDelegate(OsgiTypeConverter.java:147)
   - locked org.apache.camel.core.osgi.OsgiTypeConverter@168783db
org.apache.camel.core.osgi.OsgiTypeConverter.convertTo(OsgiTypeConverter.java:98)
org.apache.camel.util.CamelContextHelper.convertTo(CamelContextHelper.java:72)
org.apache.camel.component.bean.RegistryBean.getProcessor(RegistryBean.java:90)
org.apache.camel.component.bean.BeanProcessor.getProcessor(BeanProcessor.java:206)
org.apache.camel.component.bean.BeanProcessor.doStop(BeanProcessor.java:256)
org.apache.camel.support.ServiceSupport.stop(ServiceSupport.java:91)
org.apache.camel.util.ServiceHelper.stopService(ServiceHelper.java:112)
org.apache.camel.util.ServiceHelper.stopServices(ServiceHelper.java:128)
org.apache.camel.util.ServiceHelper.stopServices(ServiceHelper.java:97)
org.apache.camel.processor.DelegateAsyncProcessor.doStop(DelegateAsyncProcessor.java:82)
org.apache.camel.support.ServiceSupport.stop(ServiceSupport.java:91)
org.apache.camel.util.ServiceHelper.stopService(ServiceHelper.java:112)
org.apache.camel.util.ServiceHelper.stopServices(ServiceHelper.java:128)
org.apache.camel.util.ServiceHelper.stopServices(ServiceHelper.java:97)
org.apache.camel.processor.DelegateAsyncProcessor.doStop(DelegateAsyncProcessor.java:82)
org.apache.camel.processor.interceptor.TraceInterceptor.doStop(TraceInterceptor.java:364)
org.apache.camel.support.ServiceSupport.stop(ServiceSupport.java:91)
org.apache.camel.util.ServiceHelper.stopService(ServiceHelper.java:112)
org.apache.camel.util.ServiceHelper.stopServices(ServiceHelper.java:128)
org.apache.camel.util.ServiceHelper.stopServices(ServiceHelper.java:97)
org.apache.camel.processor.interceptor.DefaultChannel.doStop(DefaultChannel.java:157)
org.apache.camel.support.ServiceSupport.stop(ServiceSupport.java:91)
org.apache.camel.util.ServiceHelper.stopService(ServiceHelper.java:112)
org.apache.camel.util.ServiceHelper.stopServices(ServiceHelper.java:128)
org.apache.camel.util.ServiceHelper.stopService(ServiceHelper.java:114)
org.apache.camel.util.ServiceHelper.stopServices(ServiceHelper.java:128)
org.apache.camel.util.ServiceHelper.stopServices(ServiceHelper.java:97)
org.apache.camel.processor.MulticastProcessor.doStop(MulticastProcessor.java:952)
org.apache.camel.support.ServiceSupport.stop(ServiceSupport.java:91)
org.apache.camel.util.ServiceHelper.stopService(ServiceHelper.java:112)
org.apache.camel.util.ServiceHelper.stopServices(ServiceHelper.java:128)
org.apache.camel.util.ServiceHelper.stopServices(ServiceHelper.java:97)
org.apache.camel.processor.DelegateAsyncProcessor.doStop(DelegateAsyncProcessor.java:82)
org.apache.camel.support.ServiceSupport.stop(ServiceSupport.java:91)
org.apache.camel.util.ServiceHelper.stopService(ServiceHelper.java:112)
org.apache.camel.util.ServiceHelper.stopServices(ServiceHelper.java:128)
org.apache.camel.util.ServiceHelper.stopServices(ServiceHelper.java:97)
org.apache.camel.processor.DelegateAsyncProcessor.doStop(DelegateAsyncProcessor.java:82)
org.apache.camel.support.ServiceSupport.stop(ServiceSupport.java:91)
org.apache.camel.util.ServiceHelper.stopService(ServiceHelper.java:112)
org.apache.camel.util.ServiceHelper.stopServices(ServiceHelper.java:128)
org.apache.camel.util.ServiceHelper.stopServices(ServiceHelper.java:97)
org.apache.camel.processor.DelegateAsyncProcessor.doStop(DelegateAsyncProcessor.java:82)
org.apache.camel.support.ServiceSupport.stop(ServiceSupport.java:91)
org.apache.camel.util.ServiceHelper.stopService(ServiceHelper.java:112)
org.apache.camel.util.ServiceHelper.stopServices(ServiceHelper.java:128)
org.apache.camel.util.ServiceHelper.stopServices(ServiceHelper.java:97)
org.apache.camel.processor.DelegateAsyncProcessor.doStop(DelegateAsyncProcessor.java:82)
org.apache.camel.support.ServiceSupport.stop(ServiceSupport.java:91)
org.apache.camel.util.ServiceHelper.stopService(ServiceHelper.java:112)
org.apache.camel.util.ServiceHelper.stopServices(ServiceHelper.java:128)
org.apache.camel.util.ServiceHelper.stopServices(ServiceHelper.java:97)
org.apache.camel.impl.DefaultConsumer.doStop(DefaultConsumer.java:86)
org.apache.camel.component.http.HttpConsumer.doStop(HttpConsumer.java:63)
org.apache.camel.support.ServiceSupport.stop(ServiceSupport.java:91)
org.apache.camel.util.ServiceHelper.stopService(ServiceHelper.java:112)
org.apache.camel.impl.DefaultShutdownStrategy.shutdownNow(DefaultShutdownStrategy.java:306)
org.apache.camel.impl.DefaultShutdownStrategy$ShutdownTask.run(DefaultShutdownStrategy.java:558)
java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:471)
java.util.concurrent.FutureTask$Sync.innerRun(FutureTask.java:334)
java.util.concurrent.FutureTask.run(FutureTask.java:166)
java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145)
java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615)
java.lang.Thread.run(Thread.java:722)

                
> Prevent Deadlock Situation in Felix.acquireGlobalLock
> -----------------------------------------------------
>
>                 Key: FELIX-3067
>                 URL: https://issues.apache.org/jira/browse/FELIX-3067
>             Project: Felix
>          Issue Type: Improvement
>          Components: Framework
>    Affects Versions: framework-3.0.7, framework-3.0.8, framework-3.0.9, framework-3.2.0,
framework-3.2.1, fileinstall-3.1.10
>            Reporter: Felix Meschberger
>         Attachments: FELIX-3067.patch, FELIX-3067-sling.patch
>
>
> Every now and then we encounter deadlock situations which involve the Felix.acquireGlobalLock
method. In our use case we have the following aspects which contribute to this:
> (a) The Apache Felix Declarative Services implementation stops components (and thus causes
service unregistration) while the bundle lock is being held because this happens in a SynchronousBundleListener
while handling the STOPPING bundle event. We have to do this to ensure the bundle is not really
stopped yet to properly stop the bundle's components.
> (b) Implementing a special class loader which involves dynamically resolving packages
which in turn uses the global lock
> (c) Eclipse Gemini Blueprint implementation which operates asynchronously
> (d) synchronization in application classes
> Often times, I would assume that we can self-heal such complex deadlck situations, if
we let acquireGlobalLock time out. Looking at the calles of acquireGlobalLock there seems
to already be provision to handle this case since acquireGlobalLock returns true only if the
global lock has actually been acquired.
> This issue is kind of a companion to FELIX-3000 where deadlocks involve sending service
registration events while holding the bundle lock.

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira

Mime
View raw message