Return-Path: X-Original-To: apmail-activemq-dev-archive@www.apache.org Delivered-To: apmail-activemq-dev-archive@www.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id BF68490AB for ; Thu, 26 Jan 2012 14:51:05 +0000 (UTC) Received: (qmail 2917 invoked by uid 500); 26 Jan 2012 14:51:05 -0000 Delivered-To: apmail-activemq-dev-archive@activemq.apache.org Received: (qmail 2396 invoked by uid 500); 26 Jan 2012 14:51:04 -0000 Mailing-List: contact dev-help@activemq.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@activemq.apache.org Delivered-To: mailing list dev@activemq.apache.org Received: (qmail 2261 invoked by uid 99); 26 Jan 2012 14:51:04 -0000 Received: from nike.apache.org (HELO nike.apache.org) (192.87.106.230) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 26 Jan 2012 14:51:04 +0000 X-ASF-Spam-Status: No, hits=-2000.0 required=5.0 tests=ALL_TRUSTED,T_RP_MATCHES_RCVD X-Spam-Check-By: apache.org Received: from [140.211.11.116] (HELO hel.zones.apache.org) (140.211.11.116) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 26 Jan 2012 14:51:01 +0000 Received: from hel.zones.apache.org (hel.zones.apache.org [140.211.11.116]) by hel.zones.apache.org (Postfix) with ESMTP id 82973164681 for ; Thu, 26 Jan 2012 14:50:40 +0000 (UTC) Date: Thu, 26 Jan 2012 14:50:40 +0000 (UTC) From: "metatech (Commented) (JIRA)" To: dev@activemq.apache.org Message-ID: <1485439712.81421.1327589440549.JavaMail.tomcat@hel.zones.apache.org> In-Reply-To: <26125607.76583.1327502561633.JavaMail.tomcat@hel.zones.apache.org> Subject: [jira] [Commented] (AMQ-3681) DatabaseLocker should first cancel locking SQL statement before closing the SQL connection MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit X-JIRA-FingerPrint: 30527f35849b9dde25b450d4833f0394 X-Virus-Checked: Checked by ClamAV on apache.org [ https://issues.apache.org/jira/browse/AMQ-3681?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13193872#comment-13193872 ] metatech commented on AMQ-3681: ------------------------------- Another problem that can occur : when the network cable is unplugged, the ActiveMQ shutdown hook freezes because it cannot close the connection, which is locked by the "DefaultDatabaseLocker.keepAlive" method. The "kill" command does not work, "kill -9" is needed. Here is a second patch that also fixes this problem. {code} "ActiveMQ ShutdownHook" daemon prio=5 Thread id=73 BLOCKED oracle.jdbc.driver.PhysicalConnection.isClosed(PhysicalConnection.java:1223) org.apache.commons.dbcp.DelegatingConnection.isClosed(DelegatingConnection.java:386) org.apache.commons.dbcp.DelegatingConnection.isClosed(DelegatingConnection.java:386) org.apache.commons.dbcp.PoolingDataSource$PoolGuardConnectionWrapper.isClosed(PoolingDataSource.java:201) org.apache.activemq.store.jdbc.DefaultDatabaseLocker.stop(DefaultDatabaseLocker.java:137) org.apache.activemq.store.jdbc.JDBCPersistenceAdapter.stop(JDBCPersistenceAdapter.java:328) org.apache.activemq.util.ServiceStopper.stop(ServiceStopper.java:41) org.apache.activemq.broker.BrokerService.stop(BrokerService.java:583) org.apache.activemq.broker.BrokerService.containerShutdown(BrokerService.java:1971) org.apache.activemq.broker.BrokerService$4.run(BrokerService.java:1938) {code} > DatabaseLocker should first cancel locking SQL statement before closing the SQL connection > ------------------------------------------------------------------------------------------ > > Key: AMQ-3681 > URL: https://issues.apache.org/jira/browse/AMQ-3681 > Project: ActiveMQ > Issue Type: Bug > Components: Broker > Affects Versions: 5.4.2 > Environment: ServiceMix 4.3 > Reporter: metatech > Attachments: amq_stopping_slave.patch, amq_stopping_slave_2.patch > > Original Estimate: 1h > Remaining Estimate: 1h > > ActiveMQ is configured in a Master/Slave configuration with an Oracle database : > http://activemq.apache.org/jdbc-master-slave.html > http://servicemix.apache.org/clustering.html > When the slave node is stopping, "activemq-broker" stays forever in the "Stopping" state. > This is because the locking SQL statement cannot be interrupted by just closing the JDBC connection. It is also needed to "cancel" the SQL statement. > Here is a patch to DefaultDatabaseLocker which makes it compatible with Oracle. > Thanks. > {code} > "Thread-92" prio=10 tid=0x08c4d800 nid=0x1036 waiting for monitor entry [0x8ab3a000] > java.lang.Thread.State: BLOCKED (on object monitor) > at oracle.jdbc.driver.PhysicalConnection.isClosed(PhysicalConnection.java:1223) > - waiting to lock <0xad4367e0> (a oracle.jdbc.driver.T4CConnection) > at org.apache.commons.dbcp.DelegatingConnection.isClosed(DelegatingConnection.java:386) > at org.apache.commons.dbcp.DelegatingConnection.isClosed(DelegatingConnection.java:386) > at org.apache.commons.dbcp.PoolingDataSource$PoolGuardConnectionWrapper.isClosed(PoolingDataSource.java:201) > at org.apache.activemq.store.jdbc.DefaultDatabaseLocker.stop(DefaultDatabaseLocker.java:137) > at com.mycompany.PoolCloser.close(PoolCloser.java:77) > at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) > at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39) > at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25) > at java.lang.reflect.Method.invoke(Method.java:597) > at org.apache.aries.blueprint.utils.ReflectionUtils.invoke(ReflectionUtils.java:221) > at org.apache.aries.blueprint.container.ServiceListener.invokeMethod(ServiceListener.java:98) > at org.apache.aries.blueprint.container.ServiceListener.unregister(ServiceListener.java:65) > {code} -- This message is automatically generated by JIRA. If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa For more information on JIRA, see: http://www.atlassian.com/software/jira