From d2df7b7e85ac2016361c2d83a3930c5e6d4c9b85 Mon Sep 17 00:00:00 2001 From: Clebert Suconic Date: Thu, 7 Feb 2019 15:07:47 -0500 Subject: [PATCH] ARTEMIS-2246 Setting the max-disk-usage as 100 on the testsuite This is to avoid issues with CI and Dev Machiens, while still preserving a sensible default for production systems. --- .../config/ActiveMQDefaultConfiguration.java | 20 +++++++++++++++++-- pom.xml | 2 +- 2 files changed, 19 insertions(+), 3 deletions(-) diff --git a/artemis-core-client/src/main/java/org/apache/activemq/artemis/api/config/ActiveMQDefaultConfiguration.java b/artemis-core-client/src/main/java/org/apache/activemq/artemis/api/config/ActiveMQDefaultConfiguration.java index c6bc32f496..61f0f5d0c0 100644 --- a/artemis-core-client/src/main/java/org/apache/activemq/artemis/api/config/ActiveMQDefaultConfiguration.java +++ b/artemis-core-client/src/main/java/org/apache/activemq/artemis/api/config/ActiveMQDefaultConfiguration.java @@ -23,12 +23,16 @@ import org.apache.activemq.artemis.api.core.RoutingType; import org.apache.activemq.artemis.api.core.SimpleString; import org.apache.activemq.artemis.core.server.ComponentConfigurationRoutingType; import org.apache.activemq.artemis.utils.critical.CriticalAnalyzerPolicy; +import org.jboss.logging.Logger; /** * Default values of ActiveMQ Artemis configuration parameters. */ public final class ActiveMQDefaultConfiguration { - /* + + private static final Logger logger = Logger.getLogger(ActiveMQDefaultConfiguration.class); + + /* *

In order to avoid compile time in-lining of constants, all access is done through methods * and all fields are PRIVATE STATIC but not FINAL. This is done following the recommendation at * 13.4.9. @@ -467,7 +471,19 @@ public final class ActiveMQDefaultConfiguration { public static final long DEFAULT_GLOBAL_MAX_SIZE = Runtime.getRuntime().maxMemory() / 2; - public static final int DEFAULT_MAX_DISK_USAGE = 90; + public static final int DEFAULT_MAX_DISK_USAGE; + + static { + int maxDisk; + try { + maxDisk = Integer.parseInt(System.getProperty(ActiveMQDefaultConfiguration.getDefaultSystemPropertyPrefix() + "maxDiskUsage", "90")); + } catch (Throwable e) { + // This is not really supposed to happen, so just logging it, just in case + logger.warn(e); + maxDisk = 90; + } + DEFAULT_MAX_DISK_USAGE = maxDisk; + } public static final int DEFAULT_DISK_SCAN = 5000; diff --git a/pom.xml b/pom.xml index 3b82a86ded..d57cbea266 100644 --- a/pom.xml +++ b/pom.xml @@ -166,7 +166,7 @@ --> - -Djava.util.logging.manager=org.jboss.logmanager.LogManager + -Dbrokerconfig.maxDiskUsage=100 -Djava.util.logging.manager=org.jboss.logmanager.LogManager -Dlogging.configuration="file:${activemq.basedir}/tests/config/logging.properties" -Djava.library.path="${activemq.basedir}/artemis-native/bin" -Djgroups.bind_addr=localhost -Dorg.apache.activemq.artemis.api.core.UDPBroadcastEndpointFactory.localBindAddress=localhost -Djava.net.preferIPv4Stack=true -Dbasedir=${basedir}