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 faa25cca37..069ebf0023 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 @@ -2216,7 +2216,7 @@ public class ActiveMQServerControlImpl extends AbstractControl implements Active clearIO(); - server.stop(true); + server.fail(true); } @Override @@ -2251,7 +2251,7 @@ public class ActiveMQServerControlImpl extends AbstractControl implements Active liveOnlyPolicy.getScaleDownPolicy().getConnectors().add(0, connector); } - server.stop(true); + server.fail(true); } } diff --git a/artemis-server/src/main/java/org/apache/activemq/artemis/core/server/ActiveMQServer.java b/artemis-server/src/main/java/org/apache/activemq/artemis/core/server/ActiveMQServer.java index 42ba7a22fe..5d4aaeb8d8 100644 --- a/artemis-server/src/main/java/org/apache/activemq/artemis/core/server/ActiveMQServer.java +++ b/artemis-server/src/main/java/org/apache/activemq/artemis/core/server/ActiveMQServer.java @@ -381,7 +381,7 @@ public interface ActiveMQServer extends ServiceComponent { */ boolean isAddressBound(String address) throws Exception; - void stop(boolean failoverOnServerShutdown) throws Exception; + void fail(boolean failoverOnServerShutdown) throws Exception; Queue updateQueue(String name, RoutingType routingType, 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 c0e0c9e733..6ab95ee931 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 @@ -832,7 +832,7 @@ public class ActiveMQServerImpl implements ActiveMQServer { } @Override - public final void stop(boolean failoverOnServerShutdown) throws Exception { + public final void fail(boolean failoverOnServerShutdown) throws Exception { stop(failoverOnServerShutdown, false, false, false); } diff --git a/artemis-server/src/main/java/org/apache/activemq/artemis/core/server/impl/SharedNothingLiveActivation.java b/artemis-server/src/main/java/org/apache/activemq/artemis/core/server/impl/SharedNothingLiveActivation.java index 7e8eb5dcb4..ce67e21daa 100644 --- a/artemis-server/src/main/java/org/apache/activemq/artemis/core/server/impl/SharedNothingLiveActivation.java +++ b/artemis-server/src/main/java/org/apache/activemq/artemis/core/server/impl/SharedNothingLiveActivation.java @@ -180,7 +180,7 @@ public class SharedNothingLiveActivation extends LiveActivation { clusterConnection.addClusterTopologyListener(listener1); if (listener1.waitForBackup()) { //if we have to many backups kept or are not configured to restart just stop, otherwise restart as a backup - activeMQServer.stop(true); + activeMQServer.fail(true); ActiveMQServerLogger.LOGGER.restartingReplicatedBackupAfterFailback(); // activeMQServer.moveServerData(replicatedPolicy.getReplicaPolicy().getMaxSavedReplicatedJournalsSize()); activeMQServer.setHAPolicy(replicatedPolicy.getReplicaPolicy()); diff --git a/artemis-server/src/test/java/org/apache/activemq/artemis/tests/util/ActiveMQTestBase.java b/artemis-server/src/test/java/org/apache/activemq/artemis/tests/util/ActiveMQTestBase.java index 17f2d88396..1b35393eab 100644 --- a/artemis-server/src/test/java/org/apache/activemq/artemis/tests/util/ActiveMQTestBase.java +++ b/artemis-server/src/test/java/org/apache/activemq/artemis/tests/util/ActiveMQTestBase.java @@ -2358,7 +2358,7 @@ public abstract class ActiveMQTestBase extends Assert { clusterManager.flushExecutor(); clusterManager.clear(); Assert.assertTrue("server should be running!", server.isStarted()); - server.stop(true); + server.fail(true); if (sessions.length > 0) { // Wait to be informed of failure diff --git a/tests/extra-tests/src/test/java/org/apache/activemq/artemis/tests/extras/byteman/BMFailoverTest.java b/tests/extra-tests/src/test/java/org/apache/activemq/artemis/tests/extras/byteman/BMFailoverTest.java index e658a5372e..9ccd1f8113 100644 --- a/tests/extra-tests/src/test/java/org/apache/activemq/artemis/tests/extras/byteman/BMFailoverTest.java +++ b/tests/extra-tests/src/test/java/org/apache/activemq/artemis/tests/extras/byteman/BMFailoverTest.java @@ -71,7 +71,7 @@ public class BMFailoverTest extends FailoverTestBase { public static void stopAndThrow() throws ActiveMQUnBlockedException { if (!stopped) { try { - serverToStop.getServer().stop(true); + serverToStop.getServer().fail(true); } catch (Exception e) { e.printStackTrace(); } diff --git a/tests/extra-tests/src/test/java/org/apache/activemq/artemis/tests/extras/byteman/LargeMessageOverReplicationTest.java b/tests/extra-tests/src/test/java/org/apache/activemq/artemis/tests/extras/byteman/LargeMessageOverReplicationTest.java index d228c22dae..ddedeaa833 100644 --- a/tests/extra-tests/src/test/java/org/apache/activemq/artemis/tests/extras/byteman/LargeMessageOverReplicationTest.java +++ b/tests/extra-tests/src/test/java/org/apache/activemq/artemis/tests/extras/byteman/LargeMessageOverReplicationTest.java @@ -233,7 +233,7 @@ public class LargeMessageOverReplicationTest extends ActiveMQTestBase { try { if (messageChunkCount == 10) { - liveServer.stop(true); + liveServer.fail(true); System.err.println("activating"); if (!backupServer.waitForActivation(1, TimeUnit.MINUTES)) { diff --git a/tests/extra-tests/src/test/java/org/apache/activemq/artemis/tests/extras/byteman/RaceOnSyncLargeMessageOverReplication2Test.java b/tests/extra-tests/src/test/java/org/apache/activemq/artemis/tests/extras/byteman/RaceOnSyncLargeMessageOverReplication2Test.java index 0437ae069d..3888a3efea 100644 --- a/tests/extra-tests/src/test/java/org/apache/activemq/artemis/tests/extras/byteman/RaceOnSyncLargeMessageOverReplication2Test.java +++ b/tests/extra-tests/src/test/java/org/apache/activemq/artemis/tests/extras/byteman/RaceOnSyncLargeMessageOverReplication2Test.java @@ -221,7 +221,7 @@ public class RaceOnSyncLargeMessageOverReplication2Test extends ActiveMQTestBase waitForRemoteBackup(connection.getSessionFactory(), 30); - liveServer.stop(true); + liveServer.fail(true); Assert.assertTrue(failedOver.await(10, TimeUnit.SECONDS)); diff --git a/tests/extra-tests/src/test/java/org/apache/activemq/artemis/tests/extras/byteman/RaceOnSyncLargeMessageOverReplicationTest.java b/tests/extra-tests/src/test/java/org/apache/activemq/artemis/tests/extras/byteman/RaceOnSyncLargeMessageOverReplicationTest.java index 99818d4b61..162c4d1898 100644 --- a/tests/extra-tests/src/test/java/org/apache/activemq/artemis/tests/extras/byteman/RaceOnSyncLargeMessageOverReplicationTest.java +++ b/tests/extra-tests/src/test/java/org/apache/activemq/artemis/tests/extras/byteman/RaceOnSyncLargeMessageOverReplicationTest.java @@ -200,7 +200,7 @@ public class RaceOnSyncLargeMessageOverReplicationTest extends ActiveMQTestBase Assert.assertFalse(t.isAlive()); - liveServer.stop(true); + liveServer.fail(true); Assert.assertTrue(failedOver.await(10, TimeUnit.SECONDS)); diff --git a/tests/extra-tests/src/test/java/org/apache/activemq/artemis/tests/extras/byteman/StartStopDeadlockTest.java b/tests/extra-tests/src/test/java/org/apache/activemq/artemis/tests/extras/byteman/StartStopDeadlockTest.java index 29c885a416..03f3e19140 100644 --- a/tests/extra-tests/src/test/java/org/apache/activemq/artemis/tests/extras/byteman/StartStopDeadlockTest.java +++ b/tests/extra-tests/src/test/java/org/apache/activemq/artemis/tests/extras/byteman/StartStopDeadlockTest.java @@ -92,7 +92,7 @@ public class StartStopDeadlockTest extends ActiveMQTestBase { align.countDown(); startLatch.await(); System.out.println("Crashing...."); - serverLive.stop(true); + serverLive.fail(true); } catch (Exception e) { errors.incrementAndGet(); e.printStackTrace(); diff --git a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/client/InterruptedLargeMessageTest.java b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/client/InterruptedLargeMessageTest.java index 44015e1992..f926af195c 100644 --- a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/client/InterruptedLargeMessageTest.java +++ b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/client/InterruptedLargeMessageTest.java @@ -129,7 +129,7 @@ public class InterruptedLargeMessageTest extends LargeMessageTestBase { // ((ServerSessionImpl) srvSession).clearLargeMessage(); // } - server.stop(false); + server.fail(false); ActiveMQTestBase.forceGC(); @@ -307,7 +307,7 @@ public class InterruptedLargeMessageTest extends LargeMessageTestBase { session.rollback(); } - server.stop(false); + server.fail(false); server.start(); server.stop(); @@ -385,7 +385,7 @@ public class InterruptedLargeMessageTest extends LargeMessageTestBase { sf.close(); } - server.stop(false); + server.fail(false); server.start(); validateNoFilesOnLargeDir(); @@ -443,7 +443,7 @@ public class InterruptedLargeMessageTest extends LargeMessageTestBase { session.close(); sf.close(); - server.stop(false); + server.fail(false); server.start(); for (int start = 0; start < 2; start++) { @@ -635,7 +635,7 @@ public class InterruptedLargeMessageTest extends LargeMessageTestBase { } ((ActiveMQServerImpl) server).replaceQueueFactory(original); - server.stop(false); + server.fail(false); server.start(); server.stop(); @@ -698,7 +698,7 @@ public class InterruptedLargeMessageTest extends LargeMessageTestBase { } ((ActiveMQServerImpl) server).replaceQueueFactory(original); - server.stop(false); + server.fail(false); server.start(); server.stop(); diff --git a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/cluster/bridge/BridgeReconnectTest.java b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/cluster/bridge/BridgeReconnectTest.java index 4a6fcaa626..88c0e81589 100644 --- a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/cluster/bridge/BridgeReconnectTest.java +++ b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/cluster/bridge/BridgeReconnectTest.java @@ -155,7 +155,7 @@ public class BridgeReconnectTest extends BridgeTestBase { startServers(); waitForServerStart(server0); - server0.stop(true); + server0.fail(true); waitForServerStart(server2); @@ -206,7 +206,7 @@ public class BridgeReconnectTest extends BridgeTestBase { BridgeReconnectTest.log.info("** failing connection"); // Now we will simulate a failure of the bridge connection between server0 and server1 - server0.stop(true); + server0.fail(true); waitForServerStart(server2); @@ -285,7 +285,7 @@ public class BridgeReconnectTest extends BridgeTestBase { startServers(); // Now we will simulate a failure of the bridge connection between server0 and server1 - server0.stop(true); + server0.fail(true); locator = addServerLocator(ActiveMQClient.createServerLocatorWithHA(server2tc)).setReconnectAttempts(100); ClientSessionFactory csf0 = addSessionFactory(locator.createSessionFactory(server2tc)); diff --git a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/cluster/bridge/BridgeTest.java b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/cluster/bridge/BridgeTest.java index 2084796c40..e6a028fa98 100644 --- a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/cluster/bridge/BridgeTest.java +++ b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/cluster/bridge/BridgeTest.java @@ -1455,7 +1455,7 @@ public class BridgeTest extends ActiveMQTestBase { try { System.out.println("Stopping server"); latch.countDown(); - serverToStop.stop(false); + serverToStop.fail(false); } catch (Exception e) { e.printStackTrace(); } diff --git a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/cluster/failover/GroupingFailoverTestBase.java b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/cluster/failover/GroupingFailoverTestBase.java index 41f0e8f95f..de8c02c3e5 100644 --- a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/cluster/failover/GroupingFailoverTestBase.java +++ b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/cluster/failover/GroupingFailoverTestBase.java @@ -93,7 +93,7 @@ public abstract class GroupingFailoverTestBase extends ClusterTestBase { closeSessionFactory(0); - servers[0].stop(true); + servers[0].fail(true); waitForServerRestart(2); @@ -194,7 +194,7 @@ public abstract class GroupingFailoverTestBase extends ClusterTestBase { closeSessionFactory(0); - servers[0].stop(true); + servers[0].fail(true); waitForServerRestart(2); diff --git a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/cluster/util/SameProcessActiveMQServer.java b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/cluster/util/SameProcessActiveMQServer.java index 35e17aa625..06305b48f5 100644 --- a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/cluster/util/SameProcessActiveMQServer.java +++ b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/cluster/util/SameProcessActiveMQServer.java @@ -92,7 +92,7 @@ public class SameProcessActiveMQServer implements TestableServer { clusterManager.flushExecutor(); clusterManager.clear(); Assert.assertTrue("server should be running!", server.isStarted()); - server.stop(failover); + server.fail(failover); if (waitFailure) { // Wait to be informed of failure diff --git a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/divert/ReplicationWithDivertTest.java b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/divert/ReplicationWithDivertTest.java index ede56f1280..dc179f92c7 100644 --- a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/divert/ReplicationWithDivertTest.java +++ b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/divert/ReplicationWithDivertTest.java @@ -220,7 +220,7 @@ public class ReplicationWithDivertTest extends ActiveMQTestBase { } Assert.assertFalse(t.isAlive()); - liveServer.stop(true); + liveServer.fail(true); Assert.assertTrue(failedOver.await(10, TimeUnit.SECONDS)); { diff --git a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/jms/server/management/JMSUtil.java b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/jms/server/management/JMSUtil.java index e8af04912b..fc0b3704bc 100644 --- a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/jms/server/management/JMSUtil.java +++ b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/jms/server/management/JMSUtil.java @@ -257,7 +257,7 @@ public class JMSUtil { ClusterManager clusterManager = server.getClusterManager(); clusterManager.clear(); - server.stop(true); + server.fail(true); // Wait to be informed of failure boolean ok = latch.await(10000, TimeUnit.MILLISECONDS); diff --git a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/mqtt/imported/MQTTTest.java b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/mqtt/imported/MQTTTest.java index d8db226609..2e67dd694a 100644 --- a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/mqtt/imported/MQTTTest.java +++ b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/mqtt/imported/MQTTTest.java @@ -1886,7 +1886,7 @@ public class MQTTTest extends MQTTTestSupport { connection1.connect(); connection1.publish(address, payload.getBytes(), QoS.AT_LEAST_ONCE, true); - getServer().stop(false); + getServer().fail(false); getServer().start(); waitForServerToStart(getServer()); diff --git a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/paging/PagingWithFailoverAndCountersTest.java b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/paging/PagingWithFailoverAndCountersTest.java index 06bf59a7b5..0bc286e88e 100644 --- a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/paging/PagingWithFailoverAndCountersTest.java +++ b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/paging/PagingWithFailoverAndCountersTest.java @@ -73,7 +73,7 @@ public class PagingWithFailoverAndCountersTest extends ActiveMQTestBase { if (inProcessBackup != null) { try { - inProcessBackup.getServer().stop(false); + inProcessBackup.getServer().fail(false); } catch (Throwable ignored) { ignored.printStackTrace(); } diff --git a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/server/SimpleStartStopTest.java b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/server/SimpleStartStopTest.java index c372a2ddf3..27d6f8a038 100644 --- a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/server/SimpleStartStopTest.java +++ b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/server/SimpleStartStopTest.java @@ -47,7 +47,7 @@ public class SimpleStartStopTest extends ActiveMQTestBase { for (int i = 0; i < 50; i++) { server = createServer(true, false); server.start(); - server.stop(false); + server.fail(false); } // There shouldn't be any error from starting / stopping the server