Return-Path: Delivered-To: apmail-geronimo-dev-archive@www.apache.org Received: (qmail 94985 invoked from network); 17 Nov 2006 06:04:01 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.2) by minotaur.apache.org with SMTP; 17 Nov 2006 06:04:01 -0000 Received: (qmail 87297 invoked by uid 500); 17 Nov 2006 06:04:09 -0000 Delivered-To: apmail-geronimo-dev-archive@geronimo.apache.org Received: (qmail 87101 invoked by uid 500); 17 Nov 2006 06:04:08 -0000 Mailing-List: contact dev-help@geronimo.apache.org; run by ezmlm Precedence: bulk list-help: list-unsubscribe: List-Post: Reply-To: dev@geronimo.apache.org List-Id: Delivered-To: mailing list dev@geronimo.apache.org Received: (qmail 87090 invoked by uid 99); 17 Nov 2006 06:04:08 -0000 Received: from herse.apache.org (HELO herse.apache.org) (140.211.11.133) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 16 Nov 2006 22:04:08 -0800 X-ASF-Spam-Status: No, hits=0.0 required=10.0 tests= X-Spam-Check-By: apache.org Received: from [140.211.11.4] (HELO brutus.apache.org) (140.211.11.4) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 16 Nov 2006 22:03:57 -0800 Received: from brutus (localhost [127.0.0.1]) by brutus.apache.org (Postfix) with ESMTP id 9A832714322 for ; Thu, 16 Nov 2006 22:03:37 -0800 (PST) Message-ID: <28241196.1163743417608.JavaMail.jira@brutus> Date: Thu, 16 Nov 2006 22:03:37 -0800 (PST) From: "Matt Hogstrom (JIRA)" To: dev@geronimo.apache.org Subject: [jira] Updated: (GERONIMO-1493) Deadlock in ActiveMQ close processing In-Reply-To: <764787760.1137626322181.JavaMail.jira@ajax.apache.org> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit X-Virus-Checked: Checked by ClamAV on apache.org [ http://issues.apache.org/jira/browse/GERONIMO-1493?page=all ] Matt Hogstrom updated GERONIMO-1493: ------------------------------------ Fix Version/s: 1.x (was: 1.2) > Deadlock in ActiveMQ close processing > ------------------------------------- > > Key: GERONIMO-1493 > URL: http://issues.apache.org/jira/browse/GERONIMO-1493 > Project: Geronimo > Issue Type: Bug > Security Level: public(Regular issues) > Components: ActiveMQ > Affects Versions: 1.0 > Environment: Geronimo 1.0 > Reporter: Kevan Miller > Fix For: 1.x > > > Poor use of synchronization in ActiveMQAsfEndpointWorker can prevent Geronimo from shutting down. The problem showed up in Jira 1422 (http://issues.apache.org/jira/browse/GERONIMO-1422). And is contained in the attached file (http://issues.apache.org/jira/secure/attachment/12321750/geronimo_shutdown_stdout.txt). > The following thread is attempting to reconnect to the broker: > "Thread-91" prio=7 tid=0x08358d50 nid=0x91 waiting on condition [c082f000..c082fd98] > at java.lang.Thread.sleep(Native Method) > at org.activemq.ra.ActiveMQAsfEndpointWorker.reconnect(ActiveMQAsfEndpointWorker.java:177) > - locked <0xc7c80470> (a org.activemq.ra.ActiveMQAsfEndpointWorker) > at org.activemq.ra.ActiveMQAsfEndpointWorker.access$200(ActiveMQAsfEndpointWorker.java:40) > at org.activemq.ra.ActiveMQAsfEndpointWorker$1.run(ActiveMQAsfEndpointWorker.java:105) > - locked <0xc7c7d138> (a org.activemq.ra.ActiveMQAsfEndpointWorker$1) > at org.apache.geronimo.connector.work.WorkerContext.run(WorkerContext.java:291) > at EDU.oswego.cs.dl.util.concurrent.PooledExecutor$Worker.run(Unknown Source) > at java.lang.Thread.run(Thread.java:534) > While the following thread is attempting to close the EndpointWorker: > "Geronimo shutdown thread" prio=5 tid=0x08ed3030 nid=0x7f waiting for monitor entry [c07ed000..c07edd98] > at org.activemq.ra.ActiveMQAsfEndpointWorker.stop(ActiveMQAsfEndpointWorker.java:135) > - waiting to lock <0xc7c80470> (a org.activemq.ra.ActiveMQAsfEndpointWorker) > at org.activemq.ra.ActiveMQResourceAdapter.endpointDeactivation(ActiveMQResourceAdapter.java:261) > at org.apache.geronimo.connector.ResourceAdapterWrapper.endpointDeactivation(ResourceAdapterWrapper.java:92) > at org.apache.geronimo.connector.ResourceAdapterWrapper$$FastClassByCGLIB$$4ab28e73.invoke() > at net.sf.cglib.reflect.FastMethod.invoke(FastMethod.java:53) > at org.apache.geronimo.gbean.runtime.FastMethodInvoker.invoke(FastMethodInvoker.java:38) > at org.apache.geronimo.gbean.runtime.GBeanOperation.invoke(GBeanOperation.java:118) > at org.apache.geronimo.gbean.runtime.GBeanInstance.invoke(GBeanInstance.java:800) > at org.apache.geronimo.gbean.runtime.RawInvoker.invoke(RawInvoker.java:57) > at org.apache.geronimo.kernel.basic.RawOperationInvoker.invoke(RawOperationInvoker.java:36) > at org.apache.geronimo.kernel.basic.ProxyMethodInterceptor.intercept(ProxyMethodInterceptor.java:96) > at org.apache.geronimo.connector.ResourceAdapterWrapper$$EnhancerByCGLIB$$168e117d.endpointDeactivation() > at org.apache.geronimo.connector.ActivationSpecWrapper.deactivate(ActivationSpecWrapper.java:109) > at org.apache.geronimo.connector.ActivationSpecWrapper$$FastClassByCGLIB$$aaa078c1.invoke() > at net.sf.cglib.reflect.FastMethod.invoke(FastMethod.java:53) > at org.apache.geronimo.gbean.runtime.FastMethodInvoker.invoke(FastMethodInvoker.java:38) > at org.apache.geronimo.gbean.runtime.GBeanOperation.invoke(GBeanOperation.java:118) > at org.apache.geronimo.gbean.runtime.GBeanInstance.invoke(GBeanInstance.java:800) > at org.apache.geronimo.gbean.runtime.RawInvoker.invoke(RawInvoker.java:57) > at org.apache.geronimo.kernel.basic.RawOperationInvoker.invoke(RawOperationInvoker.java:36) > at org.apache.geronimo.kernel.basic.ProxyMethodInterceptor.intercept(ProxyMethodInterceptor.java:96) > at org.apache.geronimo.connector.ActivationSpecWrapper$$EnhancerByCGLIB$$17d592bb.deactivate() > at org.openejb.mdb.MDBContainer.doStop(MDBContainer.java:223) > at org.apache.geronimo.gbean.runtime.GBeanInstance.destroyInstance(GBeanInstance.java:1079) > at org.apache.geronimo.gbean.runtime.GBeanInstanceState.attemptFullStop(GBeanInstanceState.java:395) > at org.apache.geronimo.gbean.runtime.GBeanInstanceState.stop(GBeanInstanceState.java:200) > at org.apache.geronimo.gbean.runtime.GBeanInstance.stop(GBeanInstance.java:545) > at org.apache.geronimo.kernel.basic.BasicKernel.stopGBean(BasicKernel.java:213) > at org.apache.geronimo.gbean.runtime.GBeanInstanceState.stop(GBeanInstanceState.java:192) > at org.apache.geronimo.gbean.runtime.GBeanInstance.stop(GBeanInstance.java:545) > at org.apache.geronimo.kernel.basic.BasicKernel.stopGBean(BasicKernel.java:213) > at org.apache.geronimo.gbean.runtime.GBeanInstanceState.stop(GBeanInstanceState.java:192) > at org.apache.geronimo.gbean.runtime.GBeanInstance.stop(GBeanInstance.java:545) > at org.apache.geronimo.kernel.basic.BasicKernel.stopGBean(BasicKernel.java:213) > at org.apache.geronimo.kernel.config.ConfigurationManagerImpl$ShutdownHook.run(ConfigurationManagerImpl.java:287) > at org.apache.geronimo.kernel.basic.BasicKernel.notifyShutdownHooks(BasicKernel.java:406) > at org.apache.geronimo.kernel.basic.BasicKernel.shutdown(BasicKernel.java:383) > at org.apache.geronimo.system.main.Daemon$1.run(Daemon.java:272) > ActiveMQAsfEndpointWorker.reconnect is synchronized and is using Thread.sleep within it's retry loop (not a good idea). Since the reconnect will never succeed (the broker has been stopped), this prevents Geronimo from ever closing. I've altered the shutdown ordering. So, it's less likely that the problem will occur, but the bug still exists... > IMO, the appropriate fix is to use Thread.wait() within reconnect(); maintain/monitor appropriate state (e.g. closed = true) within reconnect() and close(), and Thread.notify() in close(). -- This message is automatically generated by JIRA. - If you think it was sent incorrectly contact one of the administrators: http://issues.apache.org/jira/secure/Administrators.jspa - For more information on JIRA, see: http://www.atlassian.com/software/jira