You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@activemq.apache.org by cl...@apache.org on 2017/09/29 13:39:36 UTC

[1/2] activemq-artemis git commit: ARTEMIS-1440 ForceFailover to be asynchronous and allow management

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 <cl...@apache.org>
Authored: Thu Sep 28 21:35:05 2017 -0400
Committer: Clebert Suconic <cl...@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 {


[2/2] activemq-artemis git commit: This closes #1563

Posted by cl...@apache.org.
This closes #1563


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

Branch: refs/heads/master
Commit: 9b4e8420d5fc5d5051c6c494e3030c9d412c9000
Parents: fbfab35 1b0fc06
Author: Clebert Suconic <cl...@apache.org>
Authored: Fri Sep 29 09:37:01 2017 -0400
Committer: Clebert Suconic <cl...@apache.org>
Committed: Fri Sep 29 09:37:01 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(-)
----------------------------------------------------------------------