Return-Path: X-Original-To: apmail-db-derby-commits-archive@www.apache.org Delivered-To: apmail-db-derby-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 BC0F797B9 for ; Tue, 3 Jul 2012 14:53:04 +0000 (UTC) Received: (qmail 53843 invoked by uid 500); 3 Jul 2012 14:53:04 -0000 Delivered-To: apmail-db-derby-commits-archive@db.apache.org Received: (qmail 53736 invoked by uid 500); 3 Jul 2012 14:53:02 -0000 Mailing-List: contact derby-commits-help@db.apache.org; run by ezmlm Precedence: bulk list-help: list-unsubscribe: List-Post: Reply-To: "Derby Development" List-Id: Delivered-To: mailing list derby-commits@db.apache.org Received: (qmail 53708 invoked by uid 99); 3 Jul 2012 14:53:01 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 03 Jul 2012 14:53:01 +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, 03 Jul 2012 14:53:00 +0000 Received: from eris.apache.org (localhost [127.0.0.1]) by eris.apache.org (Postfix) with ESMTP id 5E1FE2388847; Tue, 3 Jul 2012 14:52:40 +0000 (UTC) Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Subject: svn commit: r1356766 - /db/derby/code/trunk/java/engine/org/apache/derby/impl/db/SlaveDatabase.java Date: Tue, 03 Jul 2012 14:52:39 -0000 To: derby-commits@db.apache.org From: dag@apache.org X-Mailer: svnmailer-1.0.8-patched Message-Id: <20120703145240.5E1FE2388847@eris.apache.org> X-Virus-Checked: Checked by ClamAV on apache.org Author: dag Date: Tue Jul 3 14:52:38 2012 New Revision: 1356766 URL: http://svn.apache.org/viewvc?rev=1356766&view=rev Log: DERBY-4269 Failover did not succeed in 2 min.: testReplication_Local_3_p6_autocommit_OK Patch fix-ignored-runtime-exceptions-b Modified: db/derby/code/trunk/java/engine/org/apache/derby/impl/db/SlaveDatabase.java Modified: db/derby/code/trunk/java/engine/org/apache/derby/impl/db/SlaveDatabase.java URL: http://svn.apache.org/viewvc/db/derby/code/trunk/java/engine/org/apache/derby/impl/db/SlaveDatabase.java?rev=1356766&r1=1356765&r2=1356766&view=diff ============================================================================== --- db/derby/code/trunk/java/engine/org/apache/derby/impl/db/SlaveDatabase.java (original) +++ db/derby/code/trunk/java/engine/org/apache/derby/impl/db/SlaveDatabase.java Tue Jul 3 14:52:38 2012 @@ -37,6 +37,8 @@ import org.apache.derby.jdbc.InternalDri import java.sql.SQLException; import java.util.Properties; +import org.apache.derby.iapi.reference.MessageId; +import org.apache.derby.impl.store.replication.ReplicationLogger; /** * SlaveDatabase is an instance of Database, and is booted instead of @@ -321,11 +323,22 @@ public class SlaveDatabase extends Basic resetCurrentContextManager(bootThreadCm); bootThreadCm = null; } - } catch (StandardException se) { - // We get here when SlaveController#stopSlave has been - // called, or if a fatal exception has been thrown. - handleShutdown(se); - } + } catch (Exception e) { + // We get here when SlaveController#stopSlave has been called, + // a fatal Derby exception has been thrown, or if a run-time + // error is thrown. Log the error unconditionally to make sure + // it can be observed, since if this happens during or after + // recovery on a failover, there will be no connection attempt + // failing with the error. New connection attempts will just + // hang... + + ReplicationLogger rl = new ReplicationLogger(dbname); + rl.logError(MessageId.REPLICATION_FATAL_ERROR, e); + + if (e instanceof StandardException) { + handleShutdown((StandardException)e); + } + } } }