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 aeb9c6a085..7f89610a67 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 @@ -1928,14 +1928,7 @@ public class ActiveMQServerControlImpl extends AbstractControl implements Active clearIO(); - try - { - server.stop(true); - } - finally - { - blockOnIO(); - } + server.stop(true); } @Override 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 23beca4644..fddd13a9a0 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 @@ -753,6 +753,7 @@ public class ActiveMQServerImpl implements ActiveMQServer messagingServerControl = null; memoryManager = null; backupManager = null; + storageManager = null; sessions.clear(); 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 51c5c3ee68..c8f5d8baca 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 @@ -1019,6 +1019,14 @@ public class ActiveMQServerControlTest extends ManagementTestBase }); } + @Test + public void testForceFailover() throws Exception + { + ActiveMQServerControl serverControl = createManagementControl(); + serverControl.forceFailover(); + assertFalse(server.isStarted()); + } + protected void scaleDown(ScaleDownHandler handler) throws Exception { SimpleString address = new SimpleString("testQueue");