Github user karuturi commented on the pull request: https://github.com/apache/cloudstack/pull/885#issuecomment-143543503 @anshul1886 without the new method, how do you ensure that PowerStateUpdateTime is up to date for the vm? It may be a very old value and can be a false alarm(same issue as using update_time). @resmo already mentioned this on the commit "Due DB update optimisation, powerState will only be updated if < MAX_CONSECUTIVE_SAME_STATE_UPDATE_COUNT. That is why we can not rely on these information unless we make sure these are up to date." even if you call updatePowerState() it may not really update the power_state_update_time due to the above optimization. Hence, once the count is reached, he is calling resetVmPowerStateTracking() so that the time would be updated in next run.
--- 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. ---