mirror of https://github.com/apache/cloudstack.git
Address review comments (#338)
This adds the missing commit to the fix #335 from the upstream PR: apache/cloudstack#7977 (cherry picked from commit b5f77f9c3b53af7e8b05730da9807a2c9eb017a5) Signed-off-by: Rohit Yadav <rohit.yadav@shapeblue.com>
This commit is contained in:
parent
84fee7b896
commit
3e2717424d
|
|
@ -1190,13 +1190,12 @@ public class ResourceLimitManagerImpl extends ManagerBase implements ResourceLim
|
|||
GlobalLock lock = GlobalLock.getInternLock("ResourceCheckTask");
|
||||
try {
|
||||
if (lock.lock(30)) {
|
||||
ManagementServerHostVO msHost = managementServerHostDao.findOneByLongestRuntime();
|
||||
if (msHost == null || (msHost.getMsid() != ManagementServerNode.getManagementServerId())) {
|
||||
s_logger.debug("Skipping the resource counters recalculation task on this management server");
|
||||
lock.unlock();
|
||||
return;
|
||||
}
|
||||
try {
|
||||
ManagementServerHostVO msHost = managementServerHostDao.findOneByLongestRuntime();
|
||||
if (msHost == null || (msHost.getMsid() != ManagementServerNode.getManagementServerId())) {
|
||||
s_logger.trace("Skipping the resource counters recalculation task on this management server");
|
||||
return;
|
||||
}
|
||||
runResourceCheckTaskInternal();
|
||||
} finally {
|
||||
lock.unlock();
|
||||
|
|
|
|||
Loading…
Reference in New Issue