|
@@ -292,6 +292,10 @@ class LeaseRenewer {
|
|
@Override
|
|
@Override
|
|
public void run() {
|
|
public void run() {
|
|
try {
|
|
try {
|
|
|
|
+ if (LOG.isDebugEnabled()) {
|
|
|
|
+ LOG.debug("Lease renewer daemon for " + clientsString()
|
|
|
|
+ + " with renew id " + id + " started");
|
|
|
|
+ }
|
|
LeaseRenewer.this.run(id);
|
|
LeaseRenewer.this.run(id);
|
|
} catch(InterruptedException e) {
|
|
} catch(InterruptedException e) {
|
|
if (LOG.isDebugEnabled()) {
|
|
if (LOG.isDebugEnabled()) {
|
|
@@ -302,6 +306,10 @@ class LeaseRenewer {
|
|
synchronized(LeaseRenewer.this) {
|
|
synchronized(LeaseRenewer.this) {
|
|
Factory.INSTANCE.remove(LeaseRenewer.this);
|
|
Factory.INSTANCE.remove(LeaseRenewer.this);
|
|
}
|
|
}
|
|
|
|
+ if (LOG.isDebugEnabled()) {
|
|
|
|
+ LOG.debug("Lease renewer daemon for " + clientsString()
|
|
|
|
+ + " with renew id " + id + " exited");
|
|
|
|
+ }
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
|
|
@@ -401,6 +409,9 @@ class LeaseRenewer {
|
|
if (!c.getClientName().equals(previousName)) {
|
|
if (!c.getClientName().equals(previousName)) {
|
|
c.renewLease();
|
|
c.renewLease();
|
|
previousName = c.getClientName();
|
|
previousName = c.getClientName();
|
|
|
|
+ if (LOG.isDebugEnabled()) {
|
|
|
|
+ LOG.debug("Lease renewed for client " + previousName);
|
|
|
|
+ }
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
@@ -416,6 +427,10 @@ class LeaseRenewer {
|
|
if (System.currentTimeMillis() - lastRenewed >= getRenewalTime()) {
|
|
if (System.currentTimeMillis() - lastRenewed >= getRenewalTime()) {
|
|
try {
|
|
try {
|
|
renew();
|
|
renew();
|
|
|
|
+ if (LOG.isDebugEnabled()) {
|
|
|
|
+ LOG.debug("Lease renewer daemon for " + clientsString()
|
|
|
|
+ + " with renew id " + id + " executed");
|
|
|
|
+ }
|
|
lastRenewed = System.currentTimeMillis();
|
|
lastRenewed = System.currentTimeMillis();
|
|
} catch (SocketTimeoutException ie) {
|
|
} catch (SocketTimeoutException ie) {
|
|
LOG.warn("Failed to renew lease for " + clientsString() + " for "
|
|
LOG.warn("Failed to renew lease for " + clientsString() + " for "
|
|
@@ -435,6 +450,15 @@ class LeaseRenewer {
|
|
|
|
|
|
synchronized(this) {
|
|
synchronized(this) {
|
|
if (id != currentId || isRenewerExpired()) {
|
|
if (id != currentId || isRenewerExpired()) {
|
|
|
|
+ if (LOG.isDebugEnabled()) {
|
|
|
|
+ if (id != currentId) {
|
|
|
|
+ LOG.debug("Lease renewer daemon for " + clientsString()
|
|
|
|
+ + " with renew id " + id + " is not current");
|
|
|
|
+ } else {
|
|
|
|
+ LOG.debug("Lease renewer daemon for " + clientsString()
|
|
|
|
+ + " with renew id " + id + " expired");
|
|
|
|
+ }
|
|
|
|
+ }
|
|
//no longer the current daemon or expired
|
|
//no longer the current daemon or expired
|
|
return;
|
|
return;
|
|
}
|
|
}
|