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

 ##########
 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:
   @Pearl1594 long shot but you are using a test for '> 0'. What if the stream 
is blocking due to timing issues but not ended yet? Wouldn't we still end 
reading before end of stream?

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