activemq-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From gtu...@apache.org
Subject activemq git commit: fix intermittent failure of LeaseDatabaseLockerTest and fix log messge with lease expiry time
Date Tue, 16 Dec 2014 13:38:52 GMT
Repository: activemq
Updated Branches:
  refs/heads/trunk fc3bb5c65 -> f57fd7daa


fix intermittent failure of LeaseDatabaseLockerTest and fix log messge with lease expiry time


Project: http://git-wip-us.apache.org/repos/asf/activemq/repo
Commit: http://git-wip-us.apache.org/repos/asf/activemq/commit/f57fd7da
Tree: http://git-wip-us.apache.org/repos/asf/activemq/tree/f57fd7da
Diff: http://git-wip-us.apache.org/repos/asf/activemq/diff/f57fd7da

Branch: refs/heads/trunk
Commit: f57fd7daad85fc72e1b5a86ab45199aea462a53e
Parents: fc3bb5c
Author: gtully <gary.tully@gmail.com>
Authored: Tue Dec 16 13:35:04 2014 +0000
Committer: gtully <gary.tully@gmail.com>
Committed: Tue Dec 16 13:38:05 2014 +0000

----------------------------------------------------------------------
 .../java/org/apache/activemq/store/jdbc/LeaseDatabaseLocker.java  | 2 +-
 .../org/apache/activemq/store/jdbc/LeaseDatabaseLockerTest.java   | 3 ++-
 2 files changed, 3 insertions(+), 2 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/activemq/blob/f57fd7da/activemq-jdbc-store/src/main/java/org/apache/activemq/store/jdbc/LeaseDatabaseLocker.java
----------------------------------------------------------------------
diff --git a/activemq-jdbc-store/src/main/java/org/apache/activemq/store/jdbc/LeaseDatabaseLocker.java
b/activemq-jdbc-store/src/main/java/org/apache/activemq/store/jdbc/LeaseDatabaseLocker.java
index 502c25c..9dce47e 100644
--- a/activemq-jdbc-store/src/main/java/org/apache/activemq/store/jdbc/LeaseDatabaseLocker.java
+++ b/activemq-jdbc-store/src/main/java/org/apache/activemq/store/jdbc/LeaseDatabaseLocker.java
@@ -105,7 +105,7 @@ public class LeaseDatabaseLocker extends AbstractJDBCLocker {
             throw new RuntimeException(getLeaseHolderId() + " failing lease acquire due to
stop");
         }
 
-        LOG.info(getLeaseHolderId() + ", becoming master with lease expiry " + new Date(now)
+ " on dataSource: " + dataSource);
+        LOG.info(getLeaseHolderId() + ", becoming master with lease expiry " + new Date(now
+ lockAcquireSleepInterval) + " on dataSource: " + dataSource);
     }
 
     private void reportLeasOwnerShipAndDuration(Connection connection) throws SQLException
{

http://git-wip-us.apache.org/repos/asf/activemq/blob/f57fd7da/activemq-unit-tests/src/test/java/org/apache/activemq/store/jdbc/LeaseDatabaseLockerTest.java
----------------------------------------------------------------------
diff --git a/activemq-unit-tests/src/test/java/org/apache/activemq/store/jdbc/LeaseDatabaseLockerTest.java
b/activemq-unit-tests/src/test/java/org/apache/activemq/store/jdbc/LeaseDatabaseLockerTest.java
index b499611..774d172 100644
--- a/activemq-unit-tests/src/test/java/org/apache/activemq/store/jdbc/LeaseDatabaseLockerTest.java
+++ b/activemq-unit-tests/src/test/java/org/apache/activemq/store/jdbc/LeaseDatabaseLockerTest.java
@@ -108,7 +108,7 @@ public class LeaseDatabaseLockerTest {
             }
         });
 
-        TimeUnit.MILLISECONDS.sleep(lockerB.getLockAcquireSleepInterval());
+        TimeUnit.MILLISECONDS.sleep(lockerB.getLockAcquireSleepInterval() / 2);
         assertTrue("B is blocked", blocked.get());
 
         assertTrue("A is good", lockerA.keepAlive());
@@ -129,6 +129,7 @@ public class LeaseDatabaseLockerTest {
         // build a fake lock
         final String fakeId = "Anon";
         final Connection connection = dataSource.getConnection();
+        printLockTable(connection);
         PreparedStatement statement = connection.prepareStatement(jdbc.getStatements().getLeaseObtainStatement());
 
         final long now = System.currentTimeMillis();


Mime
View raw message