db-derby-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From oyste...@apache.org
Subject svn commit: r636833 - /db/derby/code/trunk/java/engine/org/apache/derby/impl/store/replication/slave/SlaveController.java
Date Thu, 13 Mar 2008 18:57:23 GMT
Author: oysteing
Date: Thu Mar 13 11:57:22 2008
New Revision: 636833

URL: http://svn.apache.org/viewvc?rev=636833&view=rev
Log:
DERBY-2508:Log receiver thread fails with NPE at failover when master has died
The NPE was caused by the log receiver thread trying to get the port from a closed down ReplicationMessageReceive.
Contributed by Jorgen Loland


Modified:
    db/derby/code/trunk/java/engine/org/apache/derby/impl/store/replication/slave/SlaveController.java

Modified: db/derby/code/trunk/java/engine/org/apache/derby/impl/store/replication/slave/SlaveController.java
URL: http://svn.apache.org/viewvc/db/derby/code/trunk/java/engine/org/apache/derby/impl/store/replication/slave/SlaveController.java?rev=636833&r1=636832&r2=636833&view=diff
==============================================================================
--- db/derby/code/trunk/java/engine/org/apache/derby/impl/store/replication/slave/SlaveController.java
(original)
+++ db/derby/code/trunk/java/engine/org/apache/derby/impl/store/replication/slave/SlaveController.java
Thu Mar 13 11:57:22 2008
@@ -224,6 +224,10 @@
         // connection has been established or until we are no longer
         // in replication slave mode
         receiver = new ReplicationMessageReceive(slavehost, slaveport, dbname);
+        // If slaveport was not specified when starting the slave, the
+        // receiver will use the default port. Set slaveport to the port
+        // actually used by the receiver
+        slaveport = receiver.getPort();
         while (!setupConnection()) {
             if (!inReplicationSlaveMode) {
                 // If we get here, another thread has called
@@ -349,7 +353,7 @@
             } else {
                 throw StandardException.newException
                     (SQLState.REPLICATION_CONNECTION_EXCEPTION, e,
-                    dbname, slavehost, String.valueOf(receiver.getPort()));
+                    dbname, slavehost, String.valueOf(slaveport));
             }
         }
     }



Mime
View raw message