You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@cloudstack.apache.org by GitBox <gi...@apache.org> on 2020/01/07 06:51:55 UTC

[GitHub] [cloudstack] rhtyd commented on a change in pull request #3795: Agent lb on svm

rhtyd commented on a change in pull request #3795: Agent lb on svm
URL: https://github.com/apache/cloudstack/pull/3795#discussion_r363611791
 
 

 ##########
 File path: server/src/main/java/org/apache/cloudstack/agent/lb/IndirectAgentLBServiceImpl.java
 ##########
 @@ -136,17 +144,48 @@ public int compare(Long x, Long y) {
         }
         final List <Host> agentBasedHosts = new ArrayList<>();
         for (final Host host : allHosts) {
-            if (host == null || host.getResourceState() == ResourceState.Creating || host.getResourceState() == ResourceState.Error) {
-                continue;
+            conditionallyAddHost(agentBasedHosts, host);
+        }
+        return agentBasedHosts;
+    }
+
+    private void conditionallyAddHost(List<Host> agentBasedHosts, Host host) {
+        if (host == null) {
 
 Review comment:
   We can do null checks and if host is removed or is some unsupported state like error etc.?

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
users@infra.apache.org


With regards,
Apache Git Services