mirror of https://github.com/apache/activemq.git
fix intermittent failure of LeaseDatabaseLockerTest and fix log messge with lease expiry time
This commit is contained in:
parent
fc3bb5c659
commit
f57fd7daad
|
@ -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 {
|
||||
|
|
|
@ -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();
|
||||
|
|
Loading…
Reference in New Issue