Pearl1594 commented on a change in pull request #3919: Handle EOFException 
during VR Health Check
URL: https://github.com/apache/cloudstack/pull/3919#discussion_r386964830
 
 

 ##########
 File path: utils/src/main/java/com/cloud/utils/ssh/SshHelper.java
 ##########
 @@ -207,22 +206,18 @@ public static void scpTo(String host, int port, String 
user, File pemKeyFile, St
                     if (canEndTheSshConnection(waitResultTimeoutInMs, sess, 
conditions)) {
                         break;
                     }
-
                 }
 
-                while (stdout.available() > 0) {
-                    currentReadBytes = stdout.read(buffer);
-                    sbResult.append(new String(buffer, 0, currentReadBytes));
+               while((currentReadBytes = stdout.read(buffer)) > 0) {
 
 Review comment:
   @rhtyd I did consider using that, however decided against it so at to avoid 
wrapping the Input Stream. Also used the readAllBytes() but that would increase 
the memory footprint as indicated earlier. So, went ahead with this approach.

----------------------------------------------------------------
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]


With regards,
Apache Git Services

Reply via email to