You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@qpid.apache.org by kw...@apache.org on 2018/01/29 15:43:17 UTC

qpid-broker-j git commit: QPID-8087: [Broker-J] [BDB] [HA] Ensure that node goes into ERROR if recovery fails on master event from JE

Repository: qpid-broker-j
Updated Branches:
  refs/heads/master cd20d0ae7 -> 575d2762e


QPID-8087: [Broker-J] [BDB] [HA] Ensure that node goes into ERROR if recovery fails on master event from JE


Project: http://git-wip-us.apache.org/repos/asf/qpid-broker-j/repo
Commit: http://git-wip-us.apache.org/repos/asf/qpid-broker-j/commit/575d2762
Tree: http://git-wip-us.apache.org/repos/asf/qpid-broker-j/tree/575d2762
Diff: http://git-wip-us.apache.org/repos/asf/qpid-broker-j/diff/575d2762

Branch: refs/heads/master
Commit: 575d2762e1e776fd2106aec92d5c85dc2c1770ab
Parents: cd20d0a
Author: Keith Wall <kw...@apache.org>
Authored: Mon Jan 29 15:40:47 2018 +0000
Committer: Keith Wall <kw...@apache.org>
Committed: Mon Jan 29 15:42:49 2018 +0000

----------------------------------------------------------------------
 .../berkeleydb/BDBHAVirtualHostNodeImpl.java       | 17 ++++++++++++++++-
 1 file changed, 16 insertions(+), 1 deletion(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/qpid-broker-j/blob/575d2762/bdbstore/src/main/java/org/apache/qpid/server/virtualhostnode/berkeleydb/BDBHAVirtualHostNodeImpl.java
----------------------------------------------------------------------
diff --git a/bdbstore/src/main/java/org/apache/qpid/server/virtualhostnode/berkeleydb/BDBHAVirtualHostNodeImpl.java b/bdbstore/src/main/java/org/apache/qpid/server/virtualhostnode/berkeleydb/BDBHAVirtualHostNodeImpl.java
index 04fde04..97565df 100644
--- a/bdbstore/src/main/java/org/apache/qpid/server/virtualhostnode/berkeleydb/BDBHAVirtualHostNodeImpl.java
+++ b/bdbstore/src/main/java/org/apache/qpid/server/virtualhostnode/berkeleydb/BDBHAVirtualHostNodeImpl.java
@@ -614,6 +614,7 @@ public class BDBHAVirtualHostNodeImpl extends AbstractVirtualHostNode<BDBHAVirtu
 
     private void onMaster()
     {
+        boolean success = false;
         try
         {
             boolean firstOpening = false;
@@ -679,17 +680,31 @@ public class BDBHAVirtualHostNodeImpl extends AbstractVirtualHostNode<BDBHAVirtu
                     }
                 });
             }
+            success = true;
 
         }
         catch (Exception e)
         {
             LOGGER.error("Failed to activate on hearing MASTER change event", e);
         }
+        finally
+        {
+            setState(success ? State.ACTIVE : State.ERRORED);
+        }
     }
 
     private void onReplica()
     {
-        createReplicaVirtualHost();
+        boolean success = false;
+        try
+        {
+            createReplicaVirtualHost();
+            success = true;
+        }
+        finally
+        {
+            setState(success ? State.ACTIVE : State.ERRORED);
+        }
     }
 
     private void createReplicaVirtualHost()


---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@qpid.apache.org
For additional commands, e-mail: commits-help@qpid.apache.org