sureshanaparti commented on a change in pull request #4395:
URL: https://github.com/apache/cloudstack/pull/4395#discussion_r505495972



##########
File path: 
engine/storage/src/main/java/org/apache/cloudstack/storage/image/BaseImageStoreDriverImpl.java
##########
@@ -391,12 +391,16 @@ public void copyAsync(DataObject srcdata, DataObject 
destData, AsyncCompletionCa
     private Answer sendToLeastBusyEndpoint(List<EndPoint> eps, CopyCommand 
cmd) {
         Answer answer = null;
         EndPoint endPoint = null;
-        Long epId = ssvmWithLeastMigrateJobs();
+        List<Long> epIds = ssvmWithLeastMigrateJobs();
+        Long epId = null;
+        if (!epIds.isEmpty()) {
+            epId = epIds.get(0);
+        }
         if (epId == null) {

Review comment:
       @DaanHoogland the last method _ssvmWithLeastMigrateJobs()_ returns null 
if it fails to pick ssvm and the null check seems to be valid. The same updated 
method now returns an empty list if fails. So list with empty check is fine, 
'epId' may not be required.




----------------------------------------------------------------
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:
[email protected]


Reply via email to