Return-Path: X-Original-To: apmail-activemq-commits-archive@www.apache.org Delivered-To: apmail-activemq-commits-archive@www.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id 246FB957E for ; Tue, 31 Jul 2012 13:54:23 +0000 (UTC) Received: (qmail 79417 invoked by uid 500); 31 Jul 2012 13:54:23 -0000 Delivered-To: apmail-activemq-commits-archive@activemq.apache.org Received: (qmail 79343 invoked by uid 500); 31 Jul 2012 13:54:23 -0000 Mailing-List: contact commits-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 commits@activemq.apache.org Received: (qmail 79336 invoked by uid 99); 31 Jul 2012 13:54:23 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 31 Jul 2012 13:54:23 +0000 X-ASF-Spam-Status: No, hits=-2000.0 required=5.0 tests=ALL_TRUSTED X-Spam-Check-By: apache.org Received: from [140.211.11.4] (HELO eris.apache.org) (140.211.11.4) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 31 Jul 2012 13:54:21 +0000 Received: from eris.apache.org (localhost [127.0.0.1]) by eris.apache.org (Postfix) with ESMTP id 53E2023888CD for ; Tue, 31 Jul 2012 13:53:38 +0000 (UTC) Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Subject: svn commit: r1367552 - /activemq/trunk/activemq-core/src/test/java/org/apache/activemq/broker/ft/DbRestartJDBCQueueMasterSlaveTest.java Date: Tue, 31 Jul 2012 13:53:38 -0000 To: commits@activemq.apache.org From: gtully@apache.org X-Mailer: svnmailer-1.0.8-patched Message-Id: <20120731135338.53E2023888CD@eris.apache.org> X-Virus-Checked: Checked by ClamAV on apache.org Author: gtully Date: Tue Jul 31 13:53:37 2012 New Revision: 1367552 URL: http://svn.apache.org/viewvc?rev=1367552&view=rev Log: add some context to the intermittent failure, issue is ioexception from store being treated as transport failure, if the error ocurrs on a ack commit we can expect a redelivery that won't come and fail the test Modified: activemq/trunk/activemq-core/src/test/java/org/apache/activemq/broker/ft/DbRestartJDBCQueueMasterSlaveTest.java Modified: activemq/trunk/activemq-core/src/test/java/org/apache/activemq/broker/ft/DbRestartJDBCQueueMasterSlaveTest.java URL: http://svn.apache.org/viewvc/activemq/trunk/activemq-core/src/test/java/org/apache/activemq/broker/ft/DbRestartJDBCQueueMasterSlaveTest.java?rev=1367552&r1=1367551&r2=1367552&view=diff ============================================================================== --- activemq/trunk/activemq-core/src/test/java/org/apache/activemq/broker/ft/DbRestartJDBCQueueMasterSlaveTest.java (original) +++ activemq/trunk/activemq-core/src/test/java/org/apache/activemq/broker/ft/DbRestartJDBCQueueMasterSlaveTest.java Tue Jul 31 13:53:37 2012 @@ -23,6 +23,7 @@ import javax.jms.JMSException; import javax.jms.Message; import javax.jms.MessageProducer; import javax.jms.Session; +import javax.jms.TransactionRolledBackException; import org.apache.activemq.ActiveMQConnection; import org.apache.derby.jdbc.EmbeddedDataSource; import org.slf4j.Logger; @@ -96,10 +97,28 @@ public class DbRestartJDBCQueueMasterSla receiveSession.commit(); super.consumeMessage(message, messageList); } catch (JMSException e) { - LOG.info("Faild to commit message receipt: " + message, e); + LOG.info("Failed to commit message receipt: " + message, e); try { receiveSession.rollback(); } catch (JMSException ignored) {} + + if (e.getCause() instanceof TransactionRolledBackException) { + TransactionRolledBackException transactionRolledBackException = (TransactionRolledBackException)e.getCause(); + if (transactionRolledBackException.getMessage().indexOf("in doubt") != -1) { + // failover chucked bc there is a missing reply to a commit. the ack may have got there and the reply + // was lost or the ack may be lost. + // so we may not get a resend. + // + // REVISIT: A JDBC store IO exception should not cause the connection to drop, so it needs to be wrapped + // possibly by the IOExceptionHandler + // The commit/close wrappers in jdbc TransactionContext need to delegate to the IOExceptionHandler + + // this would leave the application aware of the store failure, and possible aware of whether the commit + // was a success, rather than going into failover-retries as it does now. + + } + + } } } }