activemq-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From gtu...@apache.org
Subject svn commit: r1450213 - in /activemq/trunk: activemq-broker/src/main/java/org/apache/activemq/broker/ activemq-jdbc-store/src/main/java/org/apache/activemq/store/jdbc/
Date Tue, 26 Feb 2013 15:25:47 GMT
Author: gtully
Date: Tue Feb 26 15:25:47 2013
New Revision: 1450213

URL: http://svn.apache.org/r1450213
Log:
AMQ-4122 - add log warning if lease will expire due to mal configuration

Modified:
    activemq/trunk/activemq-broker/src/main/java/org/apache/activemq/broker/Lockable.java
    activemq/trunk/activemq-broker/src/main/java/org/apache/activemq/broker/LockableServiceSupport.java
    activemq/trunk/activemq-jdbc-store/src/main/java/org/apache/activemq/store/jdbc/LeaseDatabaseLocker.java

Modified: activemq/trunk/activemq-broker/src/main/java/org/apache/activemq/broker/Lockable.java
URL: http://svn.apache.org/viewvc/activemq/trunk/activemq-broker/src/main/java/org/apache/activemq/broker/Lockable.java?rev=1450213&r1=1450212&r2=1450213&view=diff
==============================================================================
--- activemq/trunk/activemq-broker/src/main/java/org/apache/activemq/broker/Lockable.java
(original)
+++ activemq/trunk/activemq-broker/src/main/java/org/apache/activemq/broker/Lockable.java
Tue Feb 26 15:25:47 2013
@@ -54,4 +54,5 @@ public interface Lockable {
      */
     public void setLockKeepAlivePeriod(long lockKeepAlivePeriod);
 
+    long getLockKeepAlivePeriod();
 }

Modified: activemq/trunk/activemq-broker/src/main/java/org/apache/activemq/broker/LockableServiceSupport.java
URL: http://svn.apache.org/viewvc/activemq/trunk/activemq-broker/src/main/java/org/apache/activemq/broker/LockableServiceSupport.java?rev=1450213&r1=1450212&r2=1450213&view=diff
==============================================================================
--- activemq/trunk/activemq-broker/src/main/java/org/apache/activemq/broker/LockableServiceSupport.java
(original)
+++ activemq/trunk/activemq-broker/src/main/java/org/apache/activemq/broker/LockableServiceSupport.java
Tue Feb 26 15:25:47 2013
@@ -75,6 +75,11 @@ public abstract class LockableServiceSup
     }
 
     @Override
+    public long getLockKeepAlivePeriod() {
+        return lockKeepAlivePeriod;
+    }
+
+    @Override
     public void preStart() throws Exception {
         init();
         if (useLock) {

Modified: activemq/trunk/activemq-jdbc-store/src/main/java/org/apache/activemq/store/jdbc/LeaseDatabaseLocker.java
URL: http://svn.apache.org/viewvc/activemq/trunk/activemq-jdbc-store/src/main/java/org/apache/activemq/store/jdbc/LeaseDatabaseLocker.java?rev=1450213&r1=1450212&r2=1450213&view=diff
==============================================================================
--- activemq/trunk/activemq-jdbc-store/src/main/java/org/apache/activemq/store/jdbc/LeaseDatabaseLocker.java
(original)
+++ activemq/trunk/activemq-jdbc-store/src/main/java/org/apache/activemq/store/jdbc/LeaseDatabaseLocker.java
Tue Feb 26 15:25:47 2013
@@ -64,6 +64,12 @@ public class LeaseDatabaseLocker extends
     public void doStart() throws Exception {
         stopping = false;
 
+        if (lockAcquireSleepInterval < persistenceAdapter.getLockKeepAlivePeriod()) {
+            LOG.warn("Persistence adapter keep alive period: " + persistenceAdapter.getLockKeepAlivePeriod()
+                    + ", which renews the lease, is less than lockAcquireSleepInterval: "
+ lockAcquireSleepInterval
+                    + ", the lease duration. These values will allow the lease to expire.");
+        }
+
         LOG.info(getLeaseHolderId() + " attempting to acquire exclusive lease to become the
Master broker");
         String sql = statements.getLeaseObtainStatement();
         LOG.debug(getLeaseHolderId() + " locking Query is "+sql);



Mime
View raw message