From 6e9ce27a6e36454dafa3749139ae96d45f34b380 Mon Sep 17 00:00:00 2001 From: Francesco Nigro Date: Thu, 22 Mar 2018 19:13:49 +0100 Subject: [PATCH] ARTEMIS-1767 JDBC Lock Acquisition Timeout should behave like the file based version The JDBC Lock Acquisition Timeout is no longer exposed to any user configuration and defaulted to infinite to match the behaviour of the journal (file-based) one. --- .../org/apache/activemq/artemis/cli/commands/Create.java | 4 ---- .../activemq/artemis/cli/commands/etc/database-store.txt | 1 - .../artemis/api/config/ActiveMQDefaultConfiguration.java | 2 +- .../core/deployers/impl/FileConfigurationParser.java | 1 - .../src/main/resources/schema/artemis-configuration.xsd | 7 ------- docs/user-manual/en/persistence.md | 5 ----- 6 files changed, 1 insertion(+), 19 deletions(-) diff --git a/artemis-cli/src/main/java/org/apache/activemq/artemis/cli/commands/Create.java b/artemis-cli/src/main/java/org/apache/activemq/artemis/cli/commands/Create.java index dfa8c0d113..f6d6aaae00 100644 --- a/artemis-cli/src/main/java/org/apache/activemq/artemis/cli/commands/Create.java +++ b/artemis-cli/src/main/java/org/apache/activemq/artemis/cli/commands/Create.java @@ -290,9 +290,6 @@ public class Create extends InputAbstract { @Option(name = "--jdbc-network-timeout", description = "Network timeout") long jdbcNetworkTimeout = ActiveMQDefaultConfiguration.getDefaultJdbcNetworkTimeout(); - @Option(name = "--jdbc-lock-acquisition-timeout", description = "Lock acquisition timeout") - long jdbcLockAcquisitionTimeout = ActiveMQDefaultConfiguration.getDefaultJournalLockAcquisitionTimeout(); - @Option(name = "--jdbc-lock-renew-period", description = "Lock Renew Period") long jdbcLockRenewPeriod = ActiveMQDefaultConfiguration.getDefaultJdbcLockRenewPeriodMillis(); @@ -623,7 +620,6 @@ public class Create extends InputAbstract { filters.put("${jdbcURL}", jdbcURL); filters.put("${jdbcClassName}", jdbcClassName); filters.put("${jdbcNetworkTimeout}", "" + jdbcNetworkTimeout); - filters.put("${jdbcLockAcquisitionTimeout}", "" + jdbcLockAcquisitionTimeout); filters.put("${jdbcLockRenewPeriod}", "" + jdbcLockRenewPeriod); filters.put("${jdbcLockExpiration}", "" + jdbcLockExpiration); filters.put("${jdbc}", readTextFile(ETC_DATABASE_STORE_TXT, filters)); diff --git a/artemis-cli/src/main/resources/org/apache/activemq/artemis/cli/commands/etc/database-store.txt b/artemis-cli/src/main/resources/org/apache/activemq/artemis/cli/commands/etc/database-store.txt index 57197e35eb..e5107e22bd 100644 --- a/artemis-cli/src/main/resources/org/apache/activemq/artemis/cli/commands/etc/database-store.txt +++ b/artemis-cli/src/main/resources/org/apache/activemq/artemis/cli/commands/etc/database-store.txt @@ -10,7 +10,6 @@ ${jdbcBindings} ${jdbcLargeMessages} ${jdbcPageStore} - ${jdbcLockAcquisitionTimeout} ${jdbcLockExpiration} ${jdbcLockRenewPeriod} ${jdbcNetworkTimeout} 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 87f6dad9f1..875e63a6f5 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 @@ -447,7 +447,7 @@ public final class ActiveMQDefaultConfiguration { private static final long DEFAULT_JDBC_LOCK_EXPIRATION_MILLIS = TimeUnit.SECONDS.toMillis(20); - private static final long DEFAULT_JDBC_LOCK_ACQUISITION_TIMEOUT_MILLIS = TimeUnit.SECONDS.toMillis(60); + private static final long DEFAULT_JDBC_LOCK_ACQUISITION_TIMEOUT_MILLIS = -1; // Default period to wait between connection TTL checks public static final long DEFAULT_CONNECTION_TTL_CHECK_INTERVAL = 2000; diff --git a/artemis-server/src/main/java/org/apache/activemq/artemis/core/deployers/impl/FileConfigurationParser.java b/artemis-server/src/main/java/org/apache/activemq/artemis/core/deployers/impl/FileConfigurationParser.java index 633a7168c6..730b695433 100644 --- a/artemis-server/src/main/java/org/apache/activemq/artemis/core/deployers/impl/FileConfigurationParser.java +++ b/artemis-server/src/main/java/org/apache/activemq/artemis/core/deployers/impl/FileConfigurationParser.java @@ -1470,7 +1470,6 @@ public final class FileConfigurationParser extends XMLConfigurationUtil { conf.setJdbcConnectionUrl(getString(storeNode, "jdbc-connection-url", conf.getJdbcConnectionUrl(), Validators.NO_CHECK)); conf.setJdbcDriverClassName(getString(storeNode, "jdbc-driver-class-name", conf.getJdbcDriverClassName(), Validators.NO_CHECK)); conf.setJdbcNetworkTimeout(getInteger(storeNode, "jdbc-network-timeout", conf.getJdbcNetworkTimeout(), Validators.NO_CHECK)); - conf.setJdbcLockAcquisitionTimeoutMillis(getLong(storeNode, "jdbc-lock-acquisition-timeout", conf.getJdbcLockAcquisitionTimeoutMillis(), Validators.NO_CHECK)); conf.setJdbcLockRenewPeriodMillis(getLong(storeNode, "jdbc-lock-renew-period", conf.getJdbcLockRenewPeriodMillis(), Validators.NO_CHECK)); conf.setJdbcLockExpirationMillis(getLong(storeNode, "jdbc-lock-expiration", conf.getJdbcLockExpirationMillis(), Validators.NO_CHECK)); return conf; diff --git a/artemis-server/src/main/resources/schema/artemis-configuration.xsd b/artemis-server/src/main/resources/schema/artemis-configuration.xsd index cf586c0b42..f5948dc177 100644 --- a/artemis-server/src/main/resources/schema/artemis-configuration.xsd +++ b/artemis-server/src/main/resources/schema/artemis-configuration.xsd @@ -1942,13 +1942,6 @@ - - - - The max allowed time in milliseconds while trying to acquire a JDBC lock. - - - diff --git a/docs/user-manual/en/persistence.md b/docs/user-manual/en/persistence.md index e48f785588..4abaa2a232 100644 --- a/docs/user-manual/en/persistence.md +++ b/docs/user-manual/en/persistence.md @@ -451,11 +451,6 @@ To configure Apache ActiveMQ Artemis to use a database for persisting messages a The JDBC network connection timeout in milliseconds. The default value is 20000 milliseconds (ie 20 seconds). -- `jdbc-lock-acquisition-timeout` - - The max allowed time in milliseconds while trying to acquire a JDBC lock. The default value - is 60000 milliseconds (ie 60 seconds). - - `jdbc-lock-renew-period` The period in milliseconds of the keep alive service of a JDBC lock. The default value