CE-113 extra trace log of worker VMs

This commit is contained in:
Daan Hoogland 2017-04-05 17:35:41 +02:00
parent 61189db1d9
commit 8065aedf68
1 changed files with 6 additions and 1 deletions

View File

@ -556,12 +556,17 @@ public class VmwareManagerImpl extends ManagerBase implements VmwareManager, Vmw
// "until we have found out a VMware API that can check if there are pending tasks on the subject VM"
// but as we expire jobs and those stale worker VMs stay around untill an MS reboot we opt in to have them removed anyway
Long hungWorkerTimeout = 2 * (AsyncJobManagerImpl.JobExpireMinutes.value() + AsyncJobManagerImpl.JobCancelThresholdMinutes.value()) * MILISECONDS_PER_MINUTE;
if(s_vmwareCleanOldWorderVMs.value() && System.currentTimeMillis() - startTick > hungWorkerTimeout) {
Long letsSayNow = System.currentTimeMillis();
if(s_vmwareCleanOldWorderVMs.value() && letsSayNow - startTick > hungWorkerTimeout) {
if(s_logger.isInfoEnabled()) {
s_logger.info("Worker VM expired, seconds elapsed: " + (System.currentTimeMillis() - startTick) / 1000);
}
return true;
}
if (s_logger.isTraceEnabled()) {
s_logger.trace("Worker VM with tag '" + workerTag + "' does not need recycling, yet." +
"But in " + (startTick + hungWorkerTimeout - letsSayNow) + " milisecs, though");
}
return false;
}