Github user abhinandanprateek commented on a diff in the pull request:

    https://github.com/apache/cloudstack/pull/2030#discussion_r110145877
  
    --- Diff: 
plugins/hypervisors/vmware/src/com/cloud/hypervisor/vmware/manager/VmwareManagerImpl.java
 ---
    @@ -550,15 +552,21 @@ public boolean needRecycle(String workerTag) {
                 return true;
             }
     
    -        // disable time-out check until we have found out a VMware API 
that can check if
    -        // there are pending tasks on the subject VM
    -        /*
    -                if(System.currentTimeMillis() - startTick > 
_hungWorkerTimeout) {
    -                    if(s_logger.isInfoEnabled())
    -                        s_logger.info("Worker VM expired, seconds elapsed: 
" + (System.currentTimeMillis() - startTick) / 1000);
    -                    return true;
    -                }
    -         */
    +        // this time-out check was disabled
    +        // "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;
    +        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);
    +            }
    --- End diff --
    
    For timeouts you may want to use java Duration, that is much cleaner.


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastruct...@apache.org or file a JIRA ticket
with INFRA.
---

Reply via email to