activemq-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From clebertsuco...@apache.org
Subject [1/2] activemq-artemis git commit: ARTEMIS-1440 ForceFailover to be asynchronous and allow management
Date Fri, 29 Sep 2017 13:39:36 GMT
Repository: activemq-artemis
Updated Branches:
  refs/heads/master fbfab3541 -> 9b4e8420d


ARTEMIS-1440 ForceFailover to be asynchronous and allow management


Project: http://git-wip-us.apache.org/repos/asf/activemq-artemis/repo
Commit: http://git-wip-us.apache.org/repos/asf/activemq-artemis/commit/1b0fc061
Tree: http://git-wip-us.apache.org/repos/asf/activemq-artemis/tree/1b0fc061
Diff: http://git-wip-us.apache.org/repos/asf/activemq-artemis/diff/1b0fc061

Branch: refs/heads/master
Commit: 1b0fc06196b86bb8125d89d6beea4e9664c6397e
Parents: fbfab35
Author: Clebert Suconic <clebertsuconic@apache.org>
Authored: Thu Sep 28 21:35:05 2017 -0400
Committer: Clebert Suconic <clebertsuconic@apache.org>
Committed: Fri Sep 29 09:34:30 2017 -0400

----------------------------------------------------------------------
 .../management/impl/ActiveMQServerControlImpl.java    | 14 +++++++++++++-
 .../artemis/core/server/impl/ActiveMQServerImpl.java  |  2 +-
 .../management/ActiveMQServerControlTest.java         |  1 +
 .../ActiveMQServerControlUsingCoreTest.java           |  7 -------
 4 files changed, 15 insertions(+), 9 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/1b0fc061/artemis-server/src/main/java/org/apache/activemq/artemis/core/management/impl/ActiveMQServerControlImpl.java
----------------------------------------------------------------------
diff --git a/artemis-server/src/main/java/org/apache/activemq/artemis/core/management/impl/ActiveMQServerControlImpl.java
b/artemis-server/src/main/java/org/apache/activemq/artemis/core/management/impl/ActiveMQServerControlImpl.java
index 1e44b0f..5c5d549 100644
--- a/artemis-server/src/main/java/org/apache/activemq/artemis/core/management/impl/ActiveMQServerControlImpl.java
+++ b/artemis-server/src/main/java/org/apache/activemq/artemis/core/management/impl/ActiveMQServerControlImpl.java
@@ -118,9 +118,11 @@ import org.apache.activemq.artemis.utils.JsonLoader;
 import org.apache.activemq.artemis.utils.ListUtil;
 import org.apache.activemq.artemis.utils.SecurityFormatter;
 import org.apache.activemq.artemis.utils.collections.TypedProperties;
+import org.jboss.logging.Logger;
 
 public class ActiveMQServerControlImpl extends AbstractControl implements ActiveMQServerControl,
NotificationEmitter, org.apache.activemq.artemis.core.server.management.NotificationListener
{
    // Constants -----------------------------------------------------
+   private static final Logger logger = Logger.getLogger(ActiveMQServerControlImpl.class);
 
    // Attributes ----------------------------------------------------
 
@@ -2436,7 +2438,17 @@ public class ActiveMQServerControlImpl extends AbstractControl implements
Active
 
       clearIO();
 
-      server.fail(true);
+      Thread t = new Thread() {
+         @Override
+         public void run() {
+            try {
+               server.fail(true);
+            } catch (Throwable e) {
+               logger.warn(e.getMessage(), e);
+            }
+         }
+      };
+      t.start();
    }
 
    @Override

http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/1b0fc061/artemis-server/src/main/java/org/apache/activemq/artemis/core/server/impl/ActiveMQServerImpl.java
----------------------------------------------------------------------
diff --git a/artemis-server/src/main/java/org/apache/activemq/artemis/core/server/impl/ActiveMQServerImpl.java
b/artemis-server/src/main/java/org/apache/activemq/artemis/core/server/impl/ActiveMQServerImpl.java
index 0e38732..51607e9 100644
--- a/artemis-server/src/main/java/org/apache/activemq/artemis/core/server/impl/ActiveMQServerImpl.java
+++ b/artemis-server/src/main/java/org/apache/activemq/artemis/core/server/impl/ActiveMQServerImpl.java
@@ -941,7 +941,7 @@ public class ActiveMQServerImpl implements ActiveMQServer {
 
    @Override
    public final void fail(boolean failoverOnServerShutdown) throws Exception {
-      stop(failoverOnServerShutdown, false, false, false);
+      stop(failoverOnServerShutdown, false, false, true);
    }
 
    public final void stop(boolean failoverOnServerShutdown, boolean isExit) throws Exception
{

http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/1b0fc061/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/management/ActiveMQServerControlTest.java
----------------------------------------------------------------------
diff --git a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/management/ActiveMQServerControlTest.java
b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/management/ActiveMQServerControlTest.java
index 0b6e684..38b1682 100644
--- a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/management/ActiveMQServerControlTest.java
+++ b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/management/ActiveMQServerControlTest.java
@@ -1023,6 +1023,7 @@ public class ActiveMQServerControlTest extends ManagementTestBase {
             fail(e.getMessage());
          }
       }
+      Wait.waitFor(() -> !server.isStarted());
       assertFalse(server.isStarted());
    }
 

http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/1b0fc061/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/management/ActiveMQServerControlUsingCoreTest.java
----------------------------------------------------------------------
diff --git a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/management/ActiveMQServerControlUsingCoreTest.java
b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/management/ActiveMQServerControlUsingCoreTest.java
index a78ffcf..feec568 100644
--- a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/management/ActiveMQServerControlUsingCoreTest.java
+++ b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/management/ActiveMQServerControlUsingCoreTest.java
@@ -48,13 +48,6 @@ public class ActiveMQServerControlUsingCoreTest extends ActiveMQServerControlTes
    }
 
 
-   // it doesn't make sense through the core
-   // the pool will be shutdown while a connection is being used
-   // makes no sense!
-   @Override
-   public void testForceFailover() throws Exception {
-   }
-
 
    @Override
    protected ActiveMQServerControl createManagementControl() throws Exception {


Mime
View raw message