Skip to content

Commit 8065aed

Browse files
committed
CE-113 extra trace log of worker VMs
1 parent 61189db commit 8065aed

1 file changed

Lines changed: 6 additions & 1 deletion

File tree

plugins/hypervisors/vmware/src/com/cloud/hypervisor/vmware/manager/VmwareManagerImpl.java

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -556,12 +556,17 @@ public boolean needRecycle(String workerTag) {
556556
// "until we have found out a VMware API that can check if there are pending tasks on the subject VM"
557557
// but as we expire jobs and those stale worker VMs stay around untill an MS reboot we opt in to have them removed anyway
558558
Long hungWorkerTimeout = 2 * (AsyncJobManagerImpl.JobExpireMinutes.value() + AsyncJobManagerImpl.JobCancelThresholdMinutes.value()) * MILISECONDS_PER_MINUTE;
559-
if(s_vmwareCleanOldWorderVMs.value() && System.currentTimeMillis() - startTick > hungWorkerTimeout) {
559+
Long letsSayNow = System.currentTimeMillis();
560+
if(s_vmwareCleanOldWorderVMs.value() && letsSayNow - startTick > hungWorkerTimeout) {
560561
if(s_logger.isInfoEnabled()) {
561562
s_logger.info("Worker VM expired, seconds elapsed: " + (System.currentTimeMillis() - startTick) / 1000);
562563
}
563564
return true;
564565
}
566+
if (s_logger.isTraceEnabled()) {
567+
s_logger.trace("Worker VM with tag '" + workerTag + "' does not need recycling, yet." +
568+
"But in " + (startTick + hungWorkerTimeout - letsSayNow) + " milisecs, though");
569+
}
565570
return false;
566571
}
567572

0 commit comments

Comments
 (0)