mirror of
https://github.com/apache/cloudstack.git
synced 2025-10-26 08:42:29 +01:00
During host connect multiple listeners gets invoked, one of them is the download listener. As part of processConnect() method, it checks if templates needs to be downloaded to secondary store for a particular HV type. As part of that check it computes list of HVs present in the zone. The earlier logic was to query all hosts (excluding current one) and iterate over them to make the list. This is not optimal and is bound to have some latency as the number of hosts increases. Optimized the logic by querying the list of HVs from the db. directly instead of iterating over all hosts in the zone. Conflicts: server/src/com/cloud/resource/ResourceManagerImpl.java