forked from apache/activemq-artemis
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
ARTEMIS-4436 Artemis is logging warnings during clean shutdown of server
in cluster. When we know that a node leaves a clustercleanly we shouldn't log WARN messages about it. Signed-off-by: Emmanuel Hugonnet <[email protected]>
- Loading branch information
Showing
13 changed files
with
141 additions
and
19 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
96 changes: 96 additions & 0 deletions
96
...che/activemq/artemis/tests/integration/cluster/warnings/ClusterCleanNodeShutdownTest.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,96 @@ | ||
/* | ||
* Licensed to the Apache Software Foundation (ASF) under one or more | ||
* contributor license agreements. See the NOTICE file distributed with | ||
* this work for additional information regarding copyright ownership. | ||
* The ASF licenses this file to You under the Apache License, Version 2.0 | ||
* (the "License"); you may not use this file except in compliance with | ||
* the License. You may obtain a copy of the License at | ||
* | ||
* http://www.apache.org/licenses/LICENSE-2.0 | ||
* | ||
* Unless required by applicable law or agreed to in writing, software | ||
* distributed under the License is distributed on an "AS IS" BASIS, | ||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
* See the License for the specific language governing permissions and | ||
* limitations under the License. | ||
*/ | ||
package org.apache.activemq.artemis.tests.integration.cluster.warnings; | ||
|
||
import java.lang.invoke.MethodHandles; | ||
import org.apache.activemq.artemis.core.server.cluster.impl.MessageLoadBalancingType; | ||
import org.apache.activemq.artemis.logs.AssertionLoggerHandler; | ||
import org.apache.activemq.artemis.tests.integration.cluster.distribution.ClusterTestBase; | ||
import org.apache.activemq.artemis.utils.Wait; | ||
import org.junit.Assert; | ||
import org.junit.Test; | ||
import org.slf4j.Logger; | ||
import org.slf4j.LoggerFactory; | ||
|
||
public class ClusterCleanNodeShutdownTest extends ClusterTestBase { | ||
|
||
private static final Logger logger = LoggerFactory.getLogger(MethodHandles.lookup().lookupClass()); | ||
|
||
@Test | ||
public void testNoWarningErrorsDuringRestartingNodesInCluster() throws Exception { | ||
setupServer(0, isFileStorage(), isNetty()); | ||
setupServer(1, isFileStorage(), isNetty()); | ||
|
||
setupClusterConnection("cluster0", "queues", MessageLoadBalancingType.ON_DEMAND, 1, isNetty(), 0, 1); | ||
setupClusterConnection("cluster1", "queues", MessageLoadBalancingType.ON_DEMAND, 1, isNetty(), 1, 0); | ||
|
||
startServers(0, 1); | ||
Wait.assertTrue(() -> { | ||
getServer(0).getClusterManager().getClusterController().awaitConnectionToReplicationCluster(); | ||
return true; | ||
}, 2000L); | ||
Wait.assertTrue(() -> { | ||
getServer(1).getClusterManager().getClusterController().awaitConnectionToReplicationCluster(); | ||
return true; | ||
}, 2000L); | ||
|
||
logger.debug("server 0 = {}", getServer(0).getNodeID()); | ||
logger.debug("server 1 = {}", getServer(1).getNodeID()); | ||
|
||
setupSessionFactory(0, isNetty(), 15); | ||
setupSessionFactory(1, isNetty()); | ||
|
||
// now create the 2 queues and make sure they are durable | ||
createQueue(0, "queues.testaddress", "queue10", null, true); | ||
createQueue(1, "queues.testaddress", "queue10", null, true); | ||
|
||
addConsumer(0, 0, "queue10", null); | ||
|
||
waitForBindings(0, "queues.testaddress", 1, 1, true); | ||
waitForBindings(1, "queues.testaddress", 1, 0, true); | ||
|
||
waitForBindings(0, "queues.testaddress", 1, 0, false); | ||
waitForBindings(1, "queues.testaddress", 1, 1, false); | ||
|
||
sendInRange(1, "queues.testaddress", 0, 10, true, null); | ||
try (AssertionLoggerHandler loggerHandler = new AssertionLoggerHandler(true)) { | ||
logger.debug("*****************************************************************************"); | ||
stopServers(0); | ||
// Waiting some time after stopped | ||
Wait.assertTrue(() -> !getServer(0).isStarted() && !getServer(0).isActive(), 2000L); | ||
logger.debug("*****************************************************************************"); | ||
Assert.assertFalse("Connection failure detected for an expected DISCONNECT event", loggerHandler.findText("AMQ212037", " [code=DISCONNECTED]")); | ||
Assert.assertFalse("WARN found", loggerHandler.hasLevel(AssertionLoggerHandler.LogLevel.WARN)); | ||
} | ||
startServers(0); | ||
|
||
waitForBindings(0, "queues.testaddress", 1, 1, true); | ||
waitForBindings(1, "queues.testaddress", 1, 0, true); | ||
|
||
waitForBindings(0, "queues.testaddress", 1, 0, false); | ||
waitForBindings(1, "queues.testaddress", 1, 1, false); | ||
|
||
sendInRange(1, "queues.testaddress", 10, 20, false, null); | ||
|
||
verifyReceiveAllInRange(0, 20, 0); | ||
logger.debug("*****************************************************************************"); | ||
} | ||
|
||
public boolean isNetty() { | ||
return true; | ||
} | ||
} |